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

nextjs head order on revalidated pages #20

Closed
janus-reith opened this issue Aug 26, 2021 · 2 comments
Closed

nextjs head order on revalidated pages #20

janus-reith opened this issue Aug 26, 2021 · 2 comments

Comments

@janus-reith
Copy link

janus-reith commented Aug 26, 2021

On material ui v4, there was a critical bug when used with nexjs and revalidated pages:
mui/material-ui#25307

It would lead to page layouts breaking in random ways due to orders of tags in head changing.
Fixing it was out of scope for MUI v4, and as @oliviertassinari pointed out there, the same issue was unlikely to appear in emotion since that uses prop cascading.

I'm wondering now if these issues are likely to come back when using tss-react:
What I was currently trying to solve with some of the the other issues I opened, is basically the makeStyles-defined classes having more priority than the MUI ones, although following the emotion cascading logic, it would be the opposite (Outside some component using the tss version of makeStyles first, then inside/after the MUI component defining its own styles)

So far, making the makeStyles-classes have more priority only worked by using two emotion caches, and essentialy relying on the order of elements in HEAD if I get things correctly

I will prepare a sandbox like the one in the issue above to see if I can observe the same behavior.

@garronej
Copy link
Owner

Thank you very much for the efforts you are putting into tss-react!
I am sorry I wasn't able to work on the multiple issues you discovered.
I don't think it's relevant here but I mention it anyway, there is a working setup with mui v4 and nextjs here
that you can run by doing:

git clone https://github.com/garronej/tss-react && cd tss-react
yarn
yarn build
yarn start_muiV4

@janus-reith
Copy link
Author

Thank you very much for the efforts you are putting into tss-react!

Sure, thank you for actually making this! I'm happy to help, let me know if I can support in some way.

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