Skip to content
Discussion options

You must be logged in to vote

In your example you should have had:

 export default function AnotherComponent({cas}){
  const Tag = cas;
  return <Tas />;
}

Otherwise I'd try to render a DOM element called cas.

With that out of the way.

I've been corrected on this at least once, but let me see if I can get this right this time.

The right way to pass a server component to a client component is using JSX, and not a function rather, that is, pass a React Element to the client component.

// This WON'T work
import { ClientComponent } from './client';
import { ServerComponent } from './server';

export default function Home() {
  return <ClientComponent slot={ServerComponent} />;
}

But this will:

import { ClientComponent } from

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
3 replies
@wesnolte
Comment options

@imteekay
Comment options

@icyJoseph
Comment options

Answer selected by wesnolte
Comment options

You must be logged in to vote
2 replies
@icyJoseph
Comment options

@Iftee97
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants