Skip to content

SSR issues with using UI frameworks in Next.js #73309

Answered by denis23x
FerretAngel asked this question in Help
Discussion options

You must be logged in to vote

Oh, there is a many ways to do that.

As example you can make a static layout for everything, and hide menu by default. For now you will have a static html version with links, which is fast and good for SEO.

Then make your client component (or service), which will find your button and attach click to it and make your actions.

Another trick is, you can pass part of server layout into client components:

export default async function Page() {
  return (
    <ClientComponent>
      <div>Your layout..</div>
    </ClientComponent>
  );
}

And your client component make looks like this, and you can do whatever you want 😁

"use client";

export default function ClientComponent({ children }) {
  return 

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@FerretAngel
Comment options

@denis23x
Comment options

Answer selected by FerretAngel
@FerretAngel
Comment options

@FerretAngel
Comment options

@viii47
Comment options

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