Next.js Discord

Discord Forum

Passing server info to client component

Answered
In&Out posted this in #help-forum
Open in Discord
Hey folks, i have a question about how safe is it to pass a prop to client component from a server component?
Answered by riský
also, its safe as long as the all the data you send should be visable (like dont get whole user from db and send it all - you should only send whats needed and not password per say)
View full answer

6 Replies

'use server'
function page() {
  return (
    <div><Client stuff={stuff} /></div>
  )
}

export default page
Something like this
Or do I have to do it vice versa
just going to say use server means server action and not use client but server
also, its safe as long as the all the data you send should be visable (like dont get whole user from db and send it all - you should only send whats needed and not password per say)
Answer