[V5] Getting FOUC with default Remix template
See original GitHub issueWhat package has an issue
Describe the bug
I’m getting FOUC using default Remix template with updated Remix, React and Mantine (5.0.0-alpha.19
) packages. I’ve tried using npm
and yarn
as well. The issueis visible on intiial page load as well as on error/catch boundries.
A solution I’m currently using along with npm
(https://github.com/remix-run/remix/issues/1136#issuecomment-1146647655) doesn’t work anymore due to changes in Mantine’s Emotion cache. Therefore I have tried to implement caching based on this approach from Chakra UI: https://chakra-ui.com/getting-started/remix-guide#2-provider-setup. Sadly with no luck. The only difference is that I don’t get errors in browser console due to mismatches in <head>
but FOUC is still present.
The error I get using injectStylesIntoStaticMarkup
:
react-dom.development.js:86 Warning: Expected server HTML to contain a matching <meta> in <head>.
In which browser did the problem occur
Chrome
If possible, please include a link to a codesandbox with the reproduced problem
No response
Do you know how to fix the issue
No
Are you willing to participate in fixing this issue and create a pull request with the fix
No response
Possible fix
No response
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:27 (6 by maintainers)
Top GitHub Comments
@viczam sorry, but no. also the latest update broke styles again, and I had to switch back to react17
hydrate
function, remove emotion cache and return<ClientProvider/>
. there is definitely an issue with mantine-remix style integration, because next.js doesn’t have the same issues.Update: I added a custom
emotionCache
as the docs says and it works, no warnings, hydration, or global styles issues.Works with React 18 and Mantine 5.
@rtivital what would be the consequences of making
createEmotionCache({ key: "mantine" })
the default value for theemotionCache
prop in theMantineProvider
?