TypeError: dispatcher.useState is not a function
See original GitHub issueIf you hit this error, you’re trying to use hooks after upgrading react to 16.7
, but you haven’t upgraded react-dom
to the same version!
The experience could be improved by checking for dispatcher.getState
here https://github.com/facebook/react/blob/504576306461a5ff339dc99691842f0f35a8bf4c/packages/react/src/ReactHooks.js#L17, and throwing an error that explains your -dom
package is out of date.
Closing because there is no real bug here, just hope somebody finds this useful
Issue Analytics
- State:
- Created 5 years ago
- Reactions:35
- Comments:7 (1 by maintainers)
Top Results From Across the Web
TypeError dispatcher.useState is not a function when using ...
There could be many reasons, and most are due to version incompatibilites or using a ^ in package.json : 1. Ensure react and...
Read more >JavaScript : TypeError dispatcher.useState is not a ... - YouTube
JavaScript : TypeError dispatcher. useState is not a function when using React Hooks [ Gift : Animated Search Engine ...
Read more >Invalid Hook Call Warning - React
There are three common reasons you might be seeing it: You might have mismatching versions of React and React DOM. You might be...
Read more >React 16.7 Hooks: 'React.Usestate' Is Not A Function - ADocLib
TypeError dispatcher.useState is not a function when using React Hooks. Solution: There could be many reasons and most are due to version incompatibilites....
Read more >React — Uncaught TypeError: destroy is not a function - Medium
To fix your app, change the useEffect arrow function to add curly braces and remove the Implicit Return, as shown: Now, the arrow...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Had a similar issue but I had to specify exact version
16.7.0-alpha.2
as a dep rather than the default^16.7.0-alpha.2
that would resolve to16.7.0
in my lockfile.I got this error when using Jest. and i update react-test-renderer then solved.
yarn add -D react-test-renderer@next