generated from garronej/ts-ci
-
-
Notifications
You must be signed in to change notification settings - Fork 39
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
Add an example based on the material-ui nextjs example #18
Comments
garronej
added a commit
that referenced
this issue
Aug 29, 2021
garronej
added a commit
that referenced
this issue
Aug 29, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I would like to see an example how to integrate tss-react based on this: https://github.com/mui-org/material-ui/tree/next/examples/nextjs-with-typescript
The current way things work is a bit confusing to me:
The example in the MUI docs has a shared util
createEmotionCache
which when called, always returns the result of emotionscreateCache
function.Now both _app and _document call that, _document uses it once in initial props, _app stores it global to the file.
The example here acts in a different way: The
createDocument
function returns getInitialProps logic, which internally usesgetCache
.There is no _app, but I assume looking at what index.tsx does is the same what _app would do per page. index.tsx also uses the same
getCache
function.What
getCache
basically does, is it stores acache
globally, and returns in or if it doesn't exist yet, create it usingcreateCache
from emotion.That seems to be different from what the mui example does, since _document and _app receieve their own instance here.
Some more background to why this example would help understanding the cache utilization is in #19.
Having an example using the same structure as the MUI one would help a lot to understand the differences there.
The text was updated successfully, but these errors were encountered: