@@ -4,9 +4,12 @@ Managing State
4
4
.. toctree ::
5
5
:hidden:
6
6
7
- structuring-your -state/index
8
- shared -component-state/index
7
+ how-to-structure -state/index
8
+ sharing -component-state/index
9
9
when-and-how-to-reset-state/index
10
+ simplifying-updates-with-reducers/index
11
+ deeply-sharing-state-with-contexts/index
12
+ combining-contexts-and-reducers/index
10
13
11
14
.. dropdown :: :octicon:`bookmark-fill;2em` What You'll Learn
12
15
:color: info
@@ -15,14 +18,15 @@ Managing State
15
18
16
19
.. grid :: 1 2 2 2
17
20
18
- .. grid-item-card :: :octicon:`code-square` Structuring Your State
19
- :link: structuring-your -state/index
21
+ .. grid-item-card :: :octicon:`organization` How to Structure State
22
+ :link: how-to-structure -state/index
20
23
:link-type: doc
21
24
22
- Make it easy to reason about your application by organizing its state.
25
+ Make it easy to reason about your application with strategies for organizing
26
+ state.
23
27
24
- .. grid-item-card :: :octicon:`link` Shared Component State
25
- :link: shared -component-state/index
28
+ .. grid-item-card :: :octicon:`link` Sharing Component State
29
+ :link: sharing -component-state/index
26
30
:link-type: doc
27
31
28
32
Allow components to vary vary together, by lifting state into common
@@ -35,8 +39,37 @@ Managing State
35
39
Control if and how state is preserved by understanding it's relationship to
36
40
the "UI tree".
37
41
42
+ .. grid-item-card :: :octicon:`plug` Simplifying Updates with Reducers
43
+ :link: simplifying-updates-with-reducers/index
44
+ :link-type: doc
45
+
46
+ Consolidate state update logic outside your component in a single function,
47
+ called a “reducer".
48
+
49
+ .. grid-item-card :: :octicon:`broadcast` Deeply Sharing State with Contexts
50
+ :link: deeply-sharing-state-with-contexts/index
51
+ :link-type: doc
52
+
53
+ Instead of passing shared state down deep component trees, bring state into
54
+ "contexts" instead.
55
+
56
+ .. grid-item-card :: :octicon:`rocket` Combining Contexts and Reducers
57
+ :link: combining-contexts-and-reducers/index
58
+ :link-type: doc
59
+
60
+ You can combine reducers and context together to manage state of a complex
61
+ screen.
38
62
39
- Section 4: Shared Component State
63
+
64
+ Section 1: How to Structure State
65
+ ---------------------------------
66
+
67
+ .. note ::
68
+
69
+ Under construction 🚧
70
+
71
+
72
+ Section 2: Shared Component State
40
73
---------------------------------
41
74
42
75
Sometimes, you want the state of two components to always change together. To do it,
@@ -49,13 +82,46 @@ state, the state represents the food name. Note how the component ``Table`` gets
49
82
at each change of state. The component is observing the state and reacting to state
50
83
changes automatically, just like it would do in React.
51
84
52
- .. idom :: shared -component-state/_examples/synced_inputs
85
+ .. idom :: sharing -component-state/_examples/synced_inputs
53
86
54
87
.. card ::
55
- :link: shared -component-state/index
88
+ :link: sharing -component-state/index
56
89
:link-type: doc
57
90
58
91
:octicon: `book ` Read More
59
92
^^^^^^^^^^^^^^^^^^^^^^^^^
60
93
61
94
Allow components to vary vary together, by lifting state into common parents.
95
+
96
+
97
+ Section 3: When and How to Reset State
98
+ --------------------------------------
99
+
100
+ .. note ::
101
+
102
+ Under construction 🚧
103
+
104
+
105
+ Section 4: Simplifying Updates with Reducers
106
+ --------------------------------------------
107
+
108
+ .. note ::
109
+
110
+ Under construction 🚧
111
+
112
+
113
+ Section 5: Deeply Sharing State with Contexts
114
+ ---------------------------------------------
115
+
116
+ .. note ::
117
+
118
+ Under construction 🚧
119
+
120
+
121
+
122
+ Section 6: Combining Contexts and Reducers
123
+ ------------------------------------------
124
+
125
+ .. note ::
126
+
127
+ Under construction 🚧
0 commit comments