title: Is Redux Thunk Middleware really needed in a React Hooks based App?
body: <p>In a React App designed using mostly hooks. I don't see the need for the <a href="https://github.com/reduxjs/redux-thunk" rel="nofollow noreferrer">redux-thunk</a> middleware, or am I missing something?</p>
  <p><strong>Redux-thunk approach</strong></p>
  <pre><code>const Component = () =&gt; {
  const dispatch = useDispatch()
  const user = useSelector(state =&gt; state.user)
  
  useEffect(() =&gt; {
    dispatch(getUserFromApiAndDispatch())
  }, []) 
  
  return &lt;div&gt;{user}&lt;/div&gt;
  }
  </code></pre>
  <p>Or just simply</p>
  <pre><code>const Component = () =&gt; {
  const dispatch = useDispatch()
  const user = useSelector(state =&gt; state.user)
  
  useEffect(() =&gt; {
    getUserFromApi().then(({data}) =&gt; dispatch({type: 'SET_USER'; payload: data.user})
  }, []) 
  
  return &lt;div&gt;{user}&lt;/div&gt;
  }
  </code></pre>