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: docs/src/learn/get-started.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -156,7 +156,7 @@ For example, let's say you have an array of products:
156
156
{% include "../../examples/python/quick_start/rendering_lists_products.py"%}
157
157
```
158
158
159
-
Inside your component, use the `map()` function to transform an array of products into an array of `<li>` items:
159
+
Inside your component, use list comprehension to transform an array of products into an array of `<li>` items:
160
160
161
161
```python linenums="0"
162
162
{% include "../../examples/python/quick_start/rendering_lists_list_items.py" start="# start"%}
@@ -202,7 +202,7 @@ Now you can declare a _state variable_ inside your component:
202
202
{% include "../../examples/python/quick_start/updating_the_screen_use_state_button.py" start="# start"%}
203
203
```
204
204
205
-
You’ll get two things from `use_state`: the current state (`count`), and the function that lets you update it (`set_sount`). You can give them any names, but the convention is to write `something, set_something = ...`.
205
+
You’ll get two things from `use_state`: the current state (`count`), and the function that lets you update it (`set_count`). You can give them any names, but the convention is to write `something, set_something = ...`.
206
206
207
207
The first time the button is displayed, `count` will be `0` because you passed `0` to `use_state()`. When you want to change state, call `set_count()` and pass the new value to it. Clicking this button will increment the counter:
208
208
@@ -238,7 +238,7 @@ Notice how each button "remembers" its own `count` state and doesn't affect othe
238
238
239
239
Functions starting with `use` are called _Hooks_. `use_state` is a built-in Hook provided by React. You can find other built-in Hooks in the [API reference.](../reference/use-state.md) You can also write your own Hooks by combining the existing ones.
240
240
241
-
Hooks are more restrictive than other functions. You can only call Hooks _at the top_ of your components (or other Hooks). If you want to use `useState` in a condition or a loop, extract a new component and put it there.
241
+
Hooks are more restrictive than other functions. You can only call Hooks _at the top_ of your components (or other Hooks). If you want to use `use_state` in a condition or a loop, extract a new component and put it there.
0 commit comments