[examples] Update examples to use StyledEngineProvider#24489
[examples] Update examples to use StyledEngineProvider#24489
Conversation
Blocker resolved 👌 |
|
I've run all changed examples, everything seems to work fine except the Going to create PR for it. Edited: Merged PR #24671 for fixing it. |
|
I have pushed a commit d9d8454 with:
|
@mnajdova I'm not sure to follow the rationale. Is it because it's too time-consuming to reproduce what docs/_app.js is doing? Or something else? |
These examples have custom emotion |
Ohh I see, the problem is already fixed :). |
Ah yes, we can drop it. Good catch, I forgot we have the same on the docs :) Edited: You are right, it's still required for styled-components :) |

Changes done in the PR:
Added usages of
StyledEngineProviderwithinjectFirstoption on all examples except thenextjs,nextjs-with-typescriptandssr. The reason why it was not added on these example is that the client and server need to share the same emotioncache. This requires custom cache object that can be imported from both places.Updated the
create-react-app-with-styled-componentsto have the same format and content as the other examples. Initially it was created with only theSlidercomponent, so that we can test that the switch tostyled-componentsis actually working. Now that we have more components converted, there is no need for the format to be different.Fixes #24091