Closed nojaf closed 5 months ago
Hi @nojaf, it looks like @emotion/styled
is not working with <ViewTransitions />
.
You need to find a way to update the lib's internal state after view transitions. I skimmed through @emotion/*
but didn't find an obvious way how to do that.
For more information see https://docs.astro.build/en/guides/view-transitions/#script-behavior-with-view-transitions
Thanks a bunch for this solution!
Astro Info
If this issue only occurs in one browser, which browser is a problem?
Chrome
Describe the Bug
A styled component (via React client:only) will only render correctly if it is on the initial page load. When navigating via a View Transition the style will not be applied.
What's the expected result?
The style is always applied after each page transition.
Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-wut9d2?file=src%2Fpages%2Fanother.astro
Participation