0

I'm working with NextJS 13 and exploring the capabilities of React Server components. In my current scenario, I have a "Client" component responsible for toggling between two different states. Simultaneously, I have a second component that requires access to the state values managed by the "Client" component, but has no interactivity or need to use hooks so it can be "Server" component. I'm seeking advice on the most effective approach and best practice to pass a state value from "Client" to "Server" component.

To give a better context let me try and give you a real example. So we might have a Table component with some content and a Switch component. Based on the value from Switch component data inside the table would change i assume we would compose components to look something like this:

<Switch>
 <Table />
<Switch>

or

<Switch table={<Table />} />

So my question again is how can i pass the data from Switch to Table and is this an anti pattern? Should just Table in this situation be a client component? Thanks in advance :)

stephdev
  • 29
  • 1
  • 3

0 Answers0