Styles gone after revisting page
See original GitHub issueSo I’m using react-tooltip for a register form. When I redirect to the login page, then redirect back to the register page with the register form, all the styles are gone from the tooltips. The text and css transitions still function, but the background and text color is gone.
I rebuild the tooltip bindings in useEffect with the following:
useEffect(() => { ReactTooltip.rebuild(); });
Anyone having similar problems?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:5
Top Results From Across the Web
CSS-in-JS theming lost on page reload (prod-only) #10988
In my case, gatsby-plugin-minify was making this problem, which led the production build to reload all styles after a page was loaded completely ......
Read more >CSS styles disappear after refresh in React app - Stack Overflow
When you visit /example/page/ you're trying to request /example/page/styles.css , but as that doesn't exist, your server falls back to index.
Read more >Revisiting :Visited - Joel Califa
The web has come a long way since those early days. We've gone through cycles of aesthetic trends and have become so much...
Read more >visited - CSS: Cascading Style Sheets - MDN Web Docs
The :visited CSS pseudo-class applies once the link has been visited by the user. For privacy reasons, the styles that can be modified...
Read more >visited - CSS-Tricks
Revisiting :visited, from Joel Califa, shows an example of using localstorage to style visited, in-domain links. Hacking :visited, from Una ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@faahim Had the same issue.To circumvent it for now, pass a ‘uuid’ prop to the styling component and it will not generate one on its own on re-render. Haven’t seen anything break because of this fix… yet.
<ReactTooltip uuid="<some-uuid-here>" />
@Joseppi83 thanks for raising this. Helped me zero in on the temp fix.
PS : Found the source issue which allows us to do the aforementioned fix - https://github.com/wwayne/react-tooltip/issues/580 which is what led to adding the use of a prop uuid.
@s-ashwinkumar Woo, thanks so much for all those info! When I saw it has mismatched hashes, I felt like, gosh, if it generates new ones every time, and it can go wrong, then it will go wrong at least some of the time. I know it can be reliable (UUID looks like a solid fix here), but my OCD brain wouldn’t give me the peace of mind. 😅
I’m overriding the stylings with a custom class name for now. But will use
uuid
approach next time.Thanks a ton!