October 2019
Intermediate to advanced
426 pages
11h 49m
English
Next, we are going to update our App component so that it directly dispatches the fetchTodos action. Let's migrate the App component to Hooks now:
import { useDispatch } from 'react-redux'
import { fetchTodos } from '../actions'
export default function App () {
const dispatch = useDispatch()
useEffect(() => { dispatch(fetchTodos()) }, [ dispatch ])
Read now
Unlock full access