Next.js Discord

Discord Forum

Help - How to inject props from Client Component into Children that are Server Comopnents

Unanswered
nxtintime posted this in #help-forum
Open in Discord
Hey, the title says it all.

I want to have a client component to use a specific hook and pass the outcome data to the children (which are going to be server components) as props. But i cant find a way to do so.

For context:
I'm trying to use TinaCMS which includes a react hook called "useTina()" for the visual editing feature so i tried implementing a wrapper that uses the hook and passes the data to the child component which is a server component that renders that data.

1 Reply

Brown bear
I don't think you can pass props to children from client to server component, they allowed this pattern in the first place because the server component is not supposed to know anything about the client component, which is why a client component can take in a server component, only via the children prop.