Provider Usage in Redux 6.0.0
See original GitHub issueHi, I just updated to 6.0.0 and have a question. I wrap my main component in a Provider :
public render() {
return (
<Provider store={this.store}>
<MainApp {...this.props} />
</Provider>
);
}
}
However, when running the application I get the following error which appears be caused by the usage of the provider :
react-dom.js:17859 Uncaught Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object.
at invariant (react-dom.js:17859)
at ReactCompositeComponentWrapper.instantiateReactComponent [as _instantiateReactComponent] (react-dom.js:15950)
at ReactCompositeComponentWrapper.performInitialMount (react-dom.js:4770)
at ReactCompositeComponentWrapper.mountComponent (react-dom.js:4661)
at Object.mountComponent (react-dom.js:11409)
at ReactCompositeComponentWrapper.performInitialMount (react-dom.js:4774)
at ReactCompositeComponentWrapper.mountComponent (react-dom.js:4661)
at Object.mountComponent (react-dom.js:11409)
at ReactCompositeComponentWrapper.performInitialMount (react-dom.js:4774)
at ReactCompositeComponentWrapper.mountComponent (react-dom.js:4661)
We do have some usages of withRef
but have changed all instances of withRef
to use forwardRef
. We do not pass store into any other components in the tree, but are using other redux modules with the following versions :
"react": "16.7.0",
"react-dom": "16.7.0",
"react-redux": "6.0.0",
"redux": "3.7.2",
"redux-observable": "0.19.0",
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:9 (4 by maintainers)
Top Results From Across the Web
how to implement the new react-redux v6.0.0 - Stack Overflow
Either wrap the root component in a , or pass a custom React context provider to and the corresponding React context consumer to...
Read more >Upgrading to React-Redux v6: Around the New Context API
So React-Redux upgraded to 6.0.0. ... Provider /> , the provided value to the nearest ancestor provider will be used.
Read more >react-redux - npm
Official React bindings for Redux. Performant and flexible. build status npm version npm downloads redux channel on discord. Installation. React ...
Read more >Upgrading to React-Redux v6: Around ... - A Work in Progress
So React-Redux upgraded to 6.0.0. ... Provider /> , the provided value to the nearest ancestor provider will be used.
Read more >Provider | React Redux
The <Provider /> makes the Redux store available to any nested components that have been wrapped in the connect() function. Since any React...
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
I’m having this issue as well after upgrading to react-redux 6.0.0. I think this shouldn’t be closed
@james-novino I believe it is similar to your issue, but sadly I’m not able to provide a link to my repo because it’s my employer’s private repo