#Client and Server component clarification

1 messages · Page 1 of 1 (latest)

naive isle
#

@robust wing you mind telling us how you fixed it once you do? I'm a bit confused now as well and genuinely curious 🙂

robust wing
robust wing
#

All works 🥳

Not entirely sure why the error above occured.. EIther Next automatically confimed it to client by seeing useState, or it was some kind of hot-reload bug. Either way, it thought my component is client component because the useState worked fine IIRC

naive isle
robust wing
naive isle
# robust wing Exactly. Moving onClick and useState logic into separste components and setting ...

That's very helpful to know thanks. I was kind of puzzled as to how/what/why/when SSR components should be used and wondering if I needed them at all. They made the change from SSG by default to SSR by default for a reason, which is a big change, and they recommend keeping it that way. It's becoming more clear to me now, I think these new patterns will encourage us to create smaller components