Next.js, Server component inside client component
Unanswered
Long-billed Dowitcher posted this in #help-forum
Long-billed DowitcherOP
Hello, i've put a server component (that fetch infos in my mysql DB) inside a client component but it give me a black screen (because of (display: none !important; ) and not render the element
8 Replies
Long-billed DowitcherOP
with without the server component imported and not put inside code:
with the server component imported and not put inside code:
this is the server component i import :
Tramp ant
are you passing it as a child prop to the client component?
also 'use server' is mainly intended for functions that should run only in server environment
is not meant to be used like 'use client' since by default all components are server components. To render a server component within a client component, the server component must be a prop child of the client component