Skip to content

Issue with react-redux 7.0.3 receiving 'Invalid hook call'

Notifications You must be signed in to change notification settings

scottyj503/react-redux-error

Repository files navigation

There appears to be an error (Invalid hook call) if I use react-redux version 7.0.3 in conjunction with using the connect object.

If I use version 6.0.1 I don't receive the same error and works as expected.

Expected behavior: No errors.

Steps to reproduce:

This is a test project that I created just for this example. If you clone, npm install and run you will see the specific error.

If you remove react-redux and add version 6.0.1 the code works as expected.

I put the connect object in the src/features/Test/index.js

** UPDATE **

I was able to trace the problem to webpack. Webpack adds script tag with the bundle.js into the index.html automatically. My issue was because I was adding the bundle.js into index.html explicitly, which used to work fine before hooks.

About

Issue with react-redux 7.0.3 receiving 'Invalid hook call'

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published