#Redux in Next js 13.4

15 messages · Page 1 of 1 (latest)

cobalt snow
sterile pilot
#

after wrapping up layout with provider, still pages are rendered on client side

sterile pilot
#

@cobalt snow is there any other way?

warped cobalt
rapid charm
#

The big problem here is causing for client global redux state to be on the server. Usually this is accomplished by loading some amount of defaut or database data server side, applying it to a redux store, then shipping the store state to the client as serverside/initial props. Then client side code MUST hydrate first with the redux state sent by the server. After to reconcile client side stuff, in useEffect, you add a redux action that takes saved/inferred client side state.

#

There will be a flash of info change for anything the server didnt have.

#

Serializing client state hints to query parameters or cookies can help too.

sterile pilot
#

@rapid charm any example or repo for this?

rapid charm
#

This is a major weakness of redux

sterile pilot
rapid charm
#

Are you trying to manage state that is not per-user but is global to the entire application for all users to share?

cobalt snow
rapid charm