File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,8 @@ If you use React on the web, you'll also need the same version of [ReactDOM](/ap
34
34
35
35
## Exports {/* exports* /}
36
36
37
+ ### State {/* state* /}
38
+
37
39
<YouWillLearnCard title =" useState " path =" /apis/usestate " >
38
40
39
41
Declares a state variable.
@@ -46,6 +48,34 @@ function MyComponent() {
46
48
47
49
</YouWillLearnCard>
48
50
51
+ <YouWillLearnCard title="useReducer" path="/apis/usereducer">
52
+
53
+ Declares a state variable managed with a reducer.
54
+
55
+ ` ` ` js
56
+ function MyComponent () {
57
+ const [state , dispatch ] = useReducer (reducer, { age: 42 });
58
+ // ...
59
+ ` ` `
60
+
61
+ </YouWillLearnCard>
62
+
63
+ ### Context {/*context*/}
64
+
65
+ <YouWillLearnCard title="useContext" path="/apis/usecontext">
66
+
67
+ Reads and subscribes to a context.
68
+
69
+ ` ` ` js
70
+ function MyComponent () {
71
+ const theme = useContext (ThemeContext);
72
+ // ...
73
+ ` ` `
74
+
75
+ </YouWillLearnCard>
76
+
77
+ ### Refs {/*refs*/}
78
+
49
79
<YouWillLearnCard title="useRef" path="/apis/useref">
50
80
51
81
Declares a ref.
You can’t perform that action at this time.
0 commit comments