-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
client:only ui component loses its style in a persistent island #8114
Comments
Hi. I've been looking at the reproducible example and what I did is change from client:only to client:load. This has worked for me. If you want to use client:only, documentation marks you must specify the correct framework for it to work. |
I've tested with |
Preliminary analysis: |
I love this demo btw 😀 |
Noting that this doesn't happen in prod. That's because at build time client only styles are bundled and included on the page, not injected via CSS. |
I think the only solution that's likely to work here is keeping styles marked with |
PR up |
Workaround while we strive to find a good solution: Note that the issue only occurs in DEV mode, not when build/preview for production. |
What version of
astro
are you using?2.10.9
Are you using an SSR adapter? If so, which one?
None
What package manager are you using?
npm
What operating system are you using?
Mac, Linux
What browser are you using?
Chrome
Describe the Bug
I have a
transition:persist
ent island. In that island, I get aclient:only
React component.screencast: https://storage.googleapis.com/abernier-portfolio/flyme3.mov
When I navigate to a new page:
since the Player react-component is not re-rendered, and the island persistent (
<marquee>
proves it), it's weird myimport
ed style gets touched in the head...NB: it only happens when
client:only
What's the expected result?
the client UI style should be untouched across navigation
Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-l21t7u?file=src%2Flayouts%2FLayout.astro,src%2Fpages%2Fmoon.astro,src%2Fcomponents%2FPlayer.tsx,src%2Fpages%2Findex.astro,src%2Fcomponents%2Fplayer.css&on=stackblitz
Participation
The text was updated successfully, but these errors were encountered: