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:
Pradeep Thakur
2023-04-06 18:52:24 +05:30
committed by GitHub
parent d9922dbef8
commit f681f76698

View File

@@ -313,6 +313,7 @@ Now you can declare a *state variable* inside your component:
```js
function MyButton() {
const [count, setCount] = useState(0);
// ...
```
Youll 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]`.