rgommezz/react-native-offline

Could not find store in the context of "Connect(ReduxNetworkProvider)". #207

Chandrakala-B posted onGitHub

I always get this error. Simulator Screen Shot - iPhone X - 2019-08-16 at 09 01 25

My App.js file render() { return ( <AppContainer ref={navigatorRef => { NavigationService.setTopLevelNavigator(navigatorRef); }}> ); }

Could you please help me on this to resolve.


@Chandrakala-B you need to wrap your App in a provider.

Example:

<Provider store={store}>
    <App /> 
</Provider>
posted by LiquidSean over 5 years ago

I was getting this error when I had a provider wrapping my app component. I resolved this issue by updating react-redux to the latest version.

posted by doug-stritt over 5 years ago

Closing due to being stale.

posted by rgommezz over 5 years ago

I have the same behvariour when using a switch navigator wrapped in a Provider. I don't think this issue should be disregarded that easily. I'm using react-redux 7.1.1 and react-native-offline 5.1.0.

posted by horodnicdragos over 5 years ago

I upgrade from react-redux 7.1.0 to react-redux 7.1.3 and it's worked.

posted by helderburato about 5 years ago

i upgraded to 7.1.3, no luck - also using SwitchNavigator

posted by okeybond about 5 years ago

@okeybond @horodnicdragos Did you solve the problem? I still got this problem. @rgommezz Could you reopen the issue because it is not solved in every case.

posted by dickerpulli almost 5 years ago

Can you provide a repro repo/snack?

posted by ankeetmaini almost 5 years ago

I currently have another problem: If i add the ReduxNetworkProvider into my component tree the app crashed/ends immediately after startup.

I have a git repo here https://github.com/dickerpulli/react-native-expo-demo and also a running snack here https://snack.expo.io/@dickerpulli/b47cc9

If you remove the ReduxNetworkProvider inside the App.js render() function everything works fine.

posted by dickerpulli almost 5 years ago

@dickerpulli this is because NetInfo is included inside ReduxNetworkProvider component. This seems to be NetInfo issue, since your repro uses Expo, I found these issues related to NetInfo which other people are having not related to this module.

https://github.com/react-native-community/react-native-netinfo/issues/297 https://github.com/react-native-community/react-native-netinfo/issues/289

Could you see if this helps?

posted by ankeetmaini almost 5 years ago

Thank you. I currently fixed my issue with using react-native-offline 5.2.0 instead of the latest one.

posted by dickerpulli almost 5 years ago

Fund this Issue

$0.00
Funded

Pull requests