next-redux-wrapper icon indicating copy to clipboard operation
next-redux-wrapper copied to clipboard

Client only state

Open michaelr524 opened this issue 4 years ago • 4 comments

Question

I have some client only state. How to add it (initialState) to the store separately (only on the client), without sending it with the rest of the state from server?

michaelr524 avatar Sep 11 '21 22:09 michaelr524

Hello! You can use useEffect for example.

fostyfost avatar Sep 13 '21 07:09 fostyfost

I wonder if it's possible to do it before rendering. useEffect will cause another round of rendering..

michaelr524 avatar Sep 13 '21 11:09 michaelr524

So try class component and use shouldComponentUpdate

fostyfost avatar Sep 13 '21 12:09 fostyfost

Cool 😎 thanks

On Mon, 13 Sep 2021 at 15:19 Fosty Fost @.***> wrote:

So try class component and use shouldComponentUpdate

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/kirill-konshin/next-redux-wrapper/issues/417#issuecomment-918135352, or unsubscribe https://github.com/notifications/unsubscribe-auth/AANKFFB3KIKADNXQWR25XCLUBXT6RANCNFSM5D3MD5GQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

michaelr524 avatar Sep 13 '21 12:09 michaelr524