So working on a large scale application where I need to develop a front end part. And we would like it to be SSR for SEO purposes, But when it comes to state management we have redux for that so how we are going to manage it and what should be the server-side and client-side configuration? if possible also share example. And can we define client-side routing like react-router in next.js?
Asked
Active
Viewed 9,174 times
2 Answers
6
Use the context api which comes out of the box with react. It good enough to handle most use-cases, redux still has its place but not really required if you're just building a crud app.
Example repo here : https://github.com/zeit/next.js/tree/canary/examples/with-context-api

Angad
- 503
- 4
- 9
-
Will ContextAPI persist my data if I refresh the page ? @Angad – Shamim Jul 13 '21 at 09:10
-
@Shamim no, the state will not be persisted after refresh. For that use local-storage or session-storage on client side. – EternalObserver Dec 01 '22 at 10:55
1
you can consider to use Recoil.js. and again, it depends on the scale of your application

angga
- 11
- 1