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

Cannot read property 'isConnected' of undefined when use ReduxNetworkProvider #384

Open
MaiiaZeinalova opened this issue Nov 8, 2024 · 0 comments

Comments

@MaiiaZeinalova
Copy link

Current Behavior

Can't use ReduxNetworkProvider

import * as React from 'react';
import { Provider } from 'react-redux';
import { ThemeProvider } from 'styled-components/native';
import { theme } from './theme';
import { SplashScreen } from '../common/components/splash-screen';
import { PersistGate } from 'redux-persist/integration/react';
import { persistor, store } from './store';
import { Navigator } from './navigation';
//import { NetworkProvider } from 'react-native-offline';
import { ReduxNetworkProvider } from 'react-native-offline';

export const App = () => {
    const [isLoading, setIsLoading] = React.useState(true);

    React.useEffect(() => {
        setIsLoading(false);
    }, []);

    if (isLoading) {
        return <SplashScreen />;
    }

    return (
        <Provider store={store}>
            <PersistGate loading={null} persistor={persistor}>
                <ReduxNetworkProvider>
                    <ThemeProvider theme={theme}>
                        <Navigator />
                    </ThemeProvider>
                </ReduxNetworkProvider>
            </PersistGate>
        </Provider>
    );
};
TypeError: Cannot read property 'isConnected' of undefined

This error is located at:
    in Connect(ReduxNetworkProvider) (created by App)

How to reproduce

Get an error immediately when add ReduxNetworkProvider to code

Your Environment

"react-native-offline": "^6.0.2",
"react-native": "0.74.2",
node -v v21.5.0
yarn
Screenshot 2024-11-08 at 9 16 38 AM

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

1 participant