Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GlobalStyles create multiple <style data-emotion="css-global">...<style> #208

Open
xingqiwu55555 opened this issue Mar 20, 2024 · 1 comment

Comments

@xingqiwu55555
Copy link

<GlobalStyles styles={globalStyle} />
image

As you can see:
Action: I used GlobalStyles component.
Except: only create one <style> tag.
Actual: it created multiple <style> tags.

It's not reasonable, any props to config it? or whether can optimize it directly.

@garronej
Copy link
Owner

Hello @xingqiwu55555,

In what context are you using TSS?
With Next App Dir? Next App Router? Vite?
What method are you using for setting up SSR?

https://docs.tss-react.dev/ssr/next.js ?
https://www.npmjs.com/package/@mui/material-nextjs ?

If you could come up with a repro that would be great.

At least on Vite I was unable to reproduce.

Screen.Recording.2024-03-20.at.14.26.22.mov

Beside, the GlobalStyles util from tss is almost a direct reexport of the global style from @emotion/react.

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

No branches or pull requests

2 participants