Next.js Discord

Discord Forum

How to pass props from a client component to a server component?

Black-headed Grosbeak posted this in #help-forum
Open in Discord
Black-headed GrosbeakOP
I need to pass an id from a zustand store to a server component in order to fetch data. Currently it is like that:

1. Client component uses a hook to access the state and retrieves ID
2. ID is passed to a server component (no use client) where my DB is getting fetched

but the query will be executed on my browser.. What am I doing wrong?

1 Reply