css-components icon indicating copy to clipboard operation
css-components copied to clipboard

Ssr fix

Open numito opened this issue 1 year ago • 2 comments

Fix server side rendering issue error: cannot dot into client component from server component.

numito avatar Sep 19 '24 08:09 numito

@numito thanks for this - could you share a codepen/minimal reproducible example of the error?

gg-phntms avatar Apr 01 '25 12:04 gg-phntms

@gg-phntms Of course, bootstrap a next project. You need 2 components:

  • a client component using css-components (a component that use useEffect)
  • a server component importing the client component

I will try to create a sample project with the issue and send it to you before the end of the week.

This setup will trigger the error.

numito avatar Apr 01 '25 13:04 numito