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

Is it good practice to use PersistGate in a child component?

Open johhansantana opened this issue 7 years ago • 2 comments

Hello

I'm using NextJS for SEO purposes and using redux-persist PersistGate makes my app render the loading prop instead of the application content when crawlers scan the app or if you check the source code of the app.

I have fixed this by only using PersistGate in a child component that will have the persisted data.

Would this cause any issues or is it bad practice? If so, how do I fix the server render content that PersistGate overwrites?

I'm also getting this error each time the child component that has the PersistGate opens, not sure if it's related:

Cannot read property '_fromJEN' of null

image

johhansantana avatar Aug 25 '18 03:08 johhansantana

Any progress on this, facing a similar issue.

Presist gate is rendering the loader prop instead of the children and thus affecting SEO.

I can't even move the Persist gate to a child.

Is there some way to avoid this?

rajatvijay avatar Nov 26 '18 12:11 rajatvijay

Yes, I can across the same issue after hours of debugging. SEO metadata that is set on page components does not work because the loading component is rendering (even when it is null) instead of the children. All statically generated pages therefore do not have any page-specific SEO tags.

DoubleOTheven avatar May 19 '22 12:05 DoubleOTheven