redux-persist icon indicating copy to clipboard operation
redux-persist copied to clipboard

Getting warning on using <PersistGate></PersistGate>

Open Sumitha-soman opened this issue 5 years ago • 5 comments

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.

Sumitha-soman avatar Jan 03 '20 04:01 Sumitha-soman

Any update on this, did anyone get any resolution. Or we should ignore it.

kezarmader avatar Apr 06 '20 17:04 kezarmader

@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.

ilirhushi avatar May 13 '20 21:05 ilirhushi

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.

leblancexplores avatar Oct 10 '20 19:10 leblancexplores

I believe the correct usage is loading={<YourComponent />} instead of loading={YourComponent}

papb avatar Oct 10 '20 20:10 papb

@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 am having same issue and also i tried removing loading prop as well as adding <Loader /> but non of both worked for me

prox2 avatar Dec 11 '21 01:12 prox2