mirror of
https://github.com/reactjs/react.dev.git
synced 2026-02-22 20:01:57 +00:00
Clarify a code snippet is incomplete (#5888)
* matched the curly braces #issues5887 Added matched the curly braces on the official website tutorial. #issues5887 * Update index.md --------- Co-authored-by: dan <dan.abramov@gmail.com>
This commit is contained in:
@@ -313,6 +313,7 @@ Now you can declare a *state variable* inside your component:
|
||||
```js
|
||||
function MyButton() {
|
||||
const [count, setCount] = useState(0);
|
||||
// ...
|
||||
```
|
||||
|
||||
You’ll get two things from `useState`: the current state (`count`), and the function that lets you update it (`setCount`). You can give them any names, but the convention is to write `[something, setSomething]`.
|
||||
|
||||
Reference in New Issue
Block a user