question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Provider Usage in Redux 6.0.0

See original GitHub issue

Hi, 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:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
landonaldercommented, Feb 15, 2019

I’m having this issue as well after upgrading to react-redux 6.0.0. I think this shouldn’t be closed

0reactions
landonaldercommented, Feb 18, 2019

@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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found