ReactJS, React-admin 3.3.0. Error: Could not find "store" in the context of "Connect(withRouter(WithStyles(Layout)))"

Viewed 347

I am trying to connect react-admin to my react-redux app and getting this error.

Error: Could not find "store" in the context of "Connect(withRouter(WithStyles(Layout)))". Either wrap the root component in a , or pass a custom React context provider to and the corresponding React context consumer to Connect(withRouter(WithStyles(Layout))) in connect options.

There is my admin page component:

export const AdminPage = () => {
    return (
        <Provider store={createAdminStore({ dataProvider, history })}>
            <Admin dataProvider={dataProvider} history={history} title="My Admin">
                <Resource
                    name="halls"
                    list={HallList}
                    edit={HallEdit}
                    create={HallCreate}
                />
            </Admin>
        </Provider>
  );
};

The thing is that if I remove react-admin lib via yarn remove react-admin, and then upload it again via yarn add react-admin - it works nice. But after yarn command and packages updates this error starts to appear again.

0 Answers
Related