Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error Could not find "store" in the context when adding context to the provider and connectedRouter #241

Open
vchouhan opened this issue Jan 20, 2019 · 15 comments

Comments

@vchouhan
Copy link

Based on the migration to v5 and v6 and with the following code I'm getting the error listed below.

error message on application start
Could not find "store" in the context of "Connect(Home)". Either wrap the root component in a <Provider>, or pass a custom React context provider to <Provider> and the corresponding React context consumer to Connect(Home) in connect options.

Packages:
"connected-react-router": "^6.2.1", "react-redux": "^6.0.0"

image

@shieldo
Copy link

shieldo commented Jan 21, 2019

@vchouhan Just a check: did you restart your app after bumping your local package? I'd been getting the same error until I remembered I still needed to do that.

@cristian-sima
Copy link

Same here

@cristian-sima
Copy link

@vchouhan what font are you using?

@MateuszDev96
Copy link

+1

@Filipsi
Copy link

Filipsi commented Apr 4, 2019

I am also having this problem, any updates on this?

@reisdev
Copy link

reisdev commented Apr 12, 2019

Same here!

@hgs-fredarters
Copy link

Same here.

@dagda1
Copy link

dagda1 commented Apr 20, 2019

i have this problem with an ssr react project. i saw another problem where the props apppeared to be replaced altogether with the router props

@ArseniySilin
Copy link

Same here.

1 similar comment
@draperunner
Copy link

Same here.

@BiosBoy
Copy link

BiosBoy commented Aug 2, 2019

Same problem. Any updates yet? :(

@BiosBoy
Copy link

BiosBoy commented Aug 5, 2019

I've solved it via bumping up to date all the packages linked with connected-react-router directly:
connected-react-router
react
redux
react-redux
react-router
react-router-dom

Seems like some of the inner dependencies had a problem with new connected-react-router context core.

And it works for me now! :)

@RyanPWalker
Copy link

Figured it out. All I was missing was the ReactReduxContext

import { Provider, ReactReduxContext } from 'react-redux';

render(
    <Provider store={store}>
        <ConnectedRouter history={history} context={ReactReduxContext}>
            <App />
        </ConnectedRouter>
    </Provider>,
    document.getElementById('root')
);

@crowmw
Copy link

crowmw commented Mar 26, 2020

Same here
@RyanPWalker and @BiosBoy does not help

@RyanPWalker I'm sorry

In my case, the problem concerned an outdated MaterialUI component that was creating Popovers outside the context. Changing the Popovers solved the problem.

@RyanPWalker
Copy link

RyanPWalker commented Mar 26, 2020

@crowmw Why the thumbs down? It's still a valid solution, just not for your exact case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests