I just 20 days old into nextjs so I may be missing quite a few thing.
I have a dashboard page server side rendered which has 3 components.
I have a component (tsx) with a button which when clicked should update a table on another component on the dashboard.
What is the best way to implement if server side rendering and using the 3 component is a mandatory?
Do I need to use something 3rd party like redux or app router is well equipped to achieve this
I am using nextjs 14 (app router) with typescript
2
Answers
If Component 3 and Component 2 do not have a common parent, then you could use either
If they have a common parent, then you could just have a state at the common parent and pass handler functions to set the state on Component 3 and the state itself to Component 2.