Getting warning on using <PersistGate></PersistGate>
Hi, I am using redux-persist in my project.I am getting the below warning on using the PersistGate wrapper.
index.js:1 Warning: Functions are not valid as a React child. This may happen if you return a Component instead of <Component /> from render. Or maybe you meant to call this function rather than return it. in PersistGate (at App.js:97) in Provider (at App.js:96) in ApolloProvider (at App.js:95) in ApolloProvider (at App.js:94) in App (at src/index.js:7)
Also the app.js looks like:
export const App = () => { return ( <Fragment> <PersistGate loading={Loader} persistor={persistor}> //COMPONENTS </PersistGate> </Fragment> ) }
redux-persist version:6.0.0
Hope I can get some help. Thanks.
Any update on this, did anyone get any resolution. Or we should ignore it.
@kezarmader check loading={Loader} if you are returning null on Loader that is the issue, just try to get rid of the loading if you are not using it.
I have the same issue and in my case loading={FullScreenLoading} it's just a standard functional component with no conditional render, something else is wrong here. I've also tried to convert this to a class. The environment context is ReactNative and I'm rendering a <View> and <ActivityIndicator> is all.
I believe the correct usage is loading={<YourComponent />} instead of loading={YourComponent}
@kezarmader check
loading={Loader}if you are returningnullon Loader that is the issue, just try to get rid of theloadingif you are not using it.
I am having same issue and also i tried removing loading prop as well as adding <Loader /> but non of both worked for me