fix(curriculum): clarify state variable naming in Toggle Text (#61277)

Co-authored-by: Huyen Nguyen <25715018+huyenltnguyen@users.noreply.github.com>
Co-authored-by: Ilenia <26656284+ilenia-magoni@users.noreply.github.com>
This commit is contained in:
Supravisor
2025-07-11 08:47:02 +12:00
committed by GitHub
parent 4ef79ddd33
commit b903270b75
@@ -7,13 +7,13 @@ dashedName: step-4
# --description--
In the prior lecture videos, you learned how to create state variables by using the `useState` hook like this:
In the prior lectures, you learned how to create state variables by using the `useState` hook and array destructuring:
```js
const [user, setUser] = useState("Jessica");
```
The convention for naming state variables is to use the `[example, setExample]` format, utilizing array destructuring.
The convention for naming state variables is to use the `example` and `setExample` format.
`useState` returns an array of two values. The first value is the current state. The second value is the set function that will be used to update state.