Attempted import error: 'useDispatch' is not exported from 'react-redux'
You need to use v7.1.0, current release candidate is v7.1.0-rc.1
See this page
Note: The hook APIs listed in this page are currently a release candidate! We encourage you to try them out in your applications and give feedback. We hope that the APIs are stable at this point, but be aware that there may still be changes before final release.
These hooks were first added in v7.1.0.
I just forget to give the curly braces over {useDispatch} and that's why I was facing this error!
Edit (Sept 15, 2019):
Install [email protected]
or react-redux@latest
Find latest version here: https://www.npmjs.com/package/react-redux?activeTab=versions
Install react-redux
version: 7.1.0-rc.1
or do npm install react-redux@next