[Joy][GlobalStyles] Does not work when used in a RSC directly #38494
Labels
bug 🐛
Something doesn't work
component: GlobalStyles
The React component.
good first issue
Great for first contributions. Enable to learn the contribution process.
package: joy-ui
Specific to @mui/joy
Duplicates
Latest version
Steps to reproduce 🕹
When using the
GlobalStyles
component, it requires the parent component to have the client flag ('use client';
) otherwise it throws this error:Maybe adding the client flag to this component, similar to
Box
or other UI component, would fix it.Current behavior 😯
When used in a RSC it does not work, so we need to create a wrapper component that has
'use client';
flag.Expected behavior 🤔
I expect it to accept a style object directly.
Context 🔦
Next.js with app router.
Your environment 🌎
npx @mui/envinfo
The text was updated successfully, but these errors were encountered: