October 2019
Intermediate to advanced
426 pages
11h 49m
English
We have already used this Hook. It returns a stateful value (state) and a setter function (setState) in order to update the value.
The useState Hook is used to deal with state in React. We can use it as follows:
import { useState } from 'react'const [ state, setState ] = useState(initialState)
The useState Hook replaces this.state and this.setState().
Read now
Unlock full access