October 2019
Intermediate to advanced
426 pages
11h 49m
English
First, we are going to adjust the UserBar component. Here, we can use the useUserState Hook by following these steps:
import { useUserState } from '../hooks'
const { state } = useContext(StateContext) const { user } = state
const user = useUserState()
Now the UserBar component makes use of our custom Hook instead of directly accessing the user state.
Read now
Unlock full access