You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/react/9-managing-complex-state.md
+6-4Lines changed: 6 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ In React, `props` are the "arguments" that are passed to our component. Alternat
11
11
12
12
Use `state` for internal variables, which when changed, should re-render the component. Examples include the value of a text box, whether or not a modal is open, and the current tab selection.
13
13
14
-
Using functional components, the `useState()` hook provides a value and setter capable of holding any data type. (We will explain hooks in more detail in the coming lessons. For now, don't worry about what exactly a hook is.) This allows us to hold simple variables such as:
14
+
Using functional components, the `useState()` hook provides a value and setter capable of holding any data type. This allows us to hold simple variables such as:
15
15
16
16
```js
17
17
const [count, setCount] =useState(0);
@@ -126,7 +126,7 @@ function WrapperContainer() {
126
126
}
127
127
```
128
128
129
-
@highlight 3,5,10-14,17
129
+
@highlight 3,5,10-14
130
130
131
131
Using this data in the `DisplayComponent` is simple. Use the props to render the component and call `setUnsavedText` on changes.
132
132
@@ -153,7 +153,9 @@ Next, let's wire up that button. We'll define an `onButtonClick` callback to han
0 commit comments