0

when I try to use MUI with new NextJS 13 app functionality I get next error:

You're importing a component that needs useRef. It only works in a Client Component but none of its parents are marked with "use client", so they're Server Components by default.

I avoided it once by separating all mui jsx in separate component but the problem is that I'm gonna get this error everywhere in my app. For example I need to write jsx in my layout.tsx or page.tsx which are server components by default. Can I actually use experimentall app with MUI without this kind of problems now?

Olivier Tassinari
  • 8,238
  • 4
  • 23
  • 23
PttRulez
  • 115
  • 7
  • 1
    Does this answer your question? [You're importing a component that needs useState. It only works in a Client Component, but none of its parents are marked with "use client"](https://stackoverflow.com/questions/74965849/youre-importing-a-component-that-needs-usestate-it-only-works-in-a-client-comp) – Youssouf Oumar Apr 14 '23 at 13:16

0 Answers0