Communicating data client to server component from a checkbox multi list?
Unanswered
Roseate Tern posted this in #help-forum
Roseate TernOP
Hello,
I am trying to wrap my head around how to architect communication from client to server component. My page server component makes a network request to get products, but this network request applies filtered based on the selections in a client component, that contains a multi checkbox list.
From what i've read online, it seems the only way to handle this is to push to the server component route the values of the filters, retrieve them and make the network request. This is working, but it also makes me have to pass down to the client list component, the list of selected filters, to visually check them, since every time something is selected and thus, pushed to the router, the state is lost.
Is this the correct approach? isn't there a better way? It is quite different than what i would have done before SRC, just passing the list of available filters to the client component, then each list item would handle their state and use a context to then make the network request based on the filters.
I am trying to wrap my head around how to architect communication from client to server component. My page server component makes a network request to get products, but this network request applies filtered based on the selections in a client component, that contains a multi checkbox list.
From what i've read online, it seems the only way to handle this is to push to the server component route the values of the filters, retrieve them and make the network request. This is working, but it also makes me have to pass down to the client list component, the list of selected filters, to visually check them, since every time something is selected and thus, pushed to the router, the state is lost.
Is this the correct approach? isn't there a better way? It is quite different than what i would have done before SRC, just passing the list of available filters to the client component, then each list item would handle their state and use a context to then make the network request based on the filters.
1 Reply
Roseate TernOP