Add import useState (#1906)
This commit is contained in:
parent
66b6648e49
commit
c8aa8f2aac
2
react.md
2
react.md
|
@ -341,6 +341,8 @@ See: [Hooks at a Glance](https://reactjs.org/docs/hooks-overview.html)
|
|||
### Declaring multiple state variables
|
||||
|
||||
```jsx
|
||||
import React, { useState } from 'react';
|
||||
|
||||
function ExampleWithManyStates() {
|
||||
// Declare multiple state variables!
|
||||
const [age, setAge] = useState(42);
|
||||
|
|
Loading…
Reference in New Issue