1

Following the pattern in docs for nesting server component inside client component, I get something like this.-

<Client>
    <Server />
</Client>

The idea is having interaction / state in Client, and once something change (for example a dropdownlist for filtering), the Server might reload to fetch data and refresh; intuitively I would have thought that rerendering Client would involve an automatic rerender on Server, but it's not happening, and can't find a straight forward way to pass a state props from Client to Server.

I'm guessing this should be a common scenario but can't find anything that fits in the docs, is there a known pattern to solve this?

ssantos
  • 16,001
  • 7
  • 50
  • 70
  • 1
    A state update in a component won't re-render its children. This is normal React. Now about your issue, this thread might help: https://stackoverflow.com/questions/75124513/update-server-component-after-data-has-changed-by-client-component-in-next-js – Youssouf Oumar May 17 '23 at 10:05

0 Answers0