Reputation: 73
I am fairly comfortable with React and passing state to components and setting up a CSR app, however I am getting a bit mixed up with Next.js. I understand the benefits of serving SSR pages at times but am having a hard time understanding how to tie these two together. I am making a basic app using the phillips hue API. Where I think I am at:
Questions:
Thanks for any help!
Upvotes: 1
Views: 2633
Reputation: 795
Next.js allow you to write React Components (pages/components) by JSX and allow you to implement API route like a Node server too!
Do I need a client side page rendered at this point?
It depends on your need, but I can say that you can make it SSR or CSR or both. The common use case of a page built by Next.js may happen by the following order:
Is there a way I can add state to the next.js file to have the user interact on the same page without having to render another page?
Next.js only render a page that we are accessing (one URL at a time) You can add state like common React: useState (functional component), this.setState() (class-based component),...
Upvotes: 0