You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a use case for multiple redux stores in my app. I've configures 2 stores as described in this article, by providing a React context for each provider.
Then I've created customCreateApi as described in the docs, by passing dispatch with the proper context.
When I attempt to use useGetPokemonByNameQuery in a component I face this error, of Reach could not find react-redux context value;
App will throw the same error even if I use single Provider with context. I've tried several different version of react-redux, no luck.
Although, I can use RTK Query with by dispatching inititate action manually in useEffect, then selecting it with selector from cache, but thats a hassle. Provided this in example app as App2.tsx
The text was updated successfully, but these errors were encountered:
I have a use case for multiple redux stores in my app. I've configures 2 stores as described in this article, by providing a React context for each provider.
Then I've created
customCreateApi
as described in the docs, by passing dispatch with the proper context.When I attempt to use
useGetPokemonByNameQuery
in a component I face this error, ofReach could not find react-redux context value;
I've recreated the app with Create react app
repo: https://github.com/MantasSidabras/rtk-app
index, where providers are setup: https://github.com/MantasSidabras/rtk-app/blob/main/src/index.tsx
context is defined here:https://github.com/MantasSidabras/rtk-app/blob/main/src/store/appStoreHooks.ts
api: https://github.com/MantasSidabras/rtk-app/blob/main/src/store/exampleApi/example.ts
App will throw the same error even if I use single Provider with context. I've tried several different version of react-redux, no luck.
Although, I can use RTK Query with by dispatching inititate action manually in useEffect, then selecting it with selector from cache, but thats a hassle. Provided this in example app as App2.tsx
The text was updated successfully, but these errors were encountered: