Created
November 3, 2018 05:46
-
-
Save Harshmakadia/e8b687be2d1e1ab49ab6ab2a1d691271 to your computer and use it in GitHub Desktop.
Mutliple state Hooks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function ExampleWithManyStates() { | |
// Declare multiple state variables! | |
const [age, setAge] = useState(42); | |
const [fruit, setFruit] = useState('banana'); | |
const [todos, setTodos] = useState([{ text: 'Learn Hooks' }]); | |
// ... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment