Skip to content
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

SVG Fails to display properly #1064

Open
augyg opened this issue Mar 12, 2024 · 4 comments
Open

SVG Fails to display properly #1064

augyg opened this issue Mar 12, 2024 · 4 comments

Comments

@augyg
Copy link
Contributor

augyg commented Mar 12, 2024

Fail State:
image

Should look like:
image

given the code:
image

Note: the comment in the code made no difference with or without

This happens on Firefox and Chrome ( which is all that I've tested )

this page is deployed here, to test out the behavior I describe next ( https://aceinterviewprep.app/landing/base )

On initial request to get the page it renders perfectly fine however if you click on any link (eg. login) and then hit the back button or click solutions > coding bootcamps (or any) then click the Ace logo to go back then you will see the top image

I have no understanding of why this is happening but even if my code is funky, it should still render the same each time right?

@augyg
Copy link
Contributor Author

augyg commented Mar 12, 2024

I can see that when it loads properly it has the data-ssr attribute

I have no idea why or if this matters though, I'm guessing hydration?

image

@augyg
Copy link
Contributor Author

augyg commented Mar 13, 2024

It seems that the only way it displays properly is from the initial server side render.

prerender_ mySvg mySvg also recreates the issue

@alexfmpe
Copy link
Contributor

#828 seems relevant
Think I also ran into this a long time ago, but workarounded some other way.

@augyg
Copy link
Contributor Author

augyg commented Mar 16, 2024

thanks @alexfmpe, based on what I saw with the outdated reflex-dom-SVG package and some investigation, I wouldn't be surprised if the workaround in #828 would work here

I just made the SVG in figma instead but hopefully I can test this soon.

Feels like this should become part of FAQ for reflex-dom as the behavior is relatively surprising, I wonder if reflex-dom-contrib has solutions yet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants