Skip to content

New styles overridden in DOM after hot update. #23

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

Closed
phyllisstein opened this issue Jul 15, 2017 · 3 comments
Closed

New styles overridden in DOM after hot update. #23

phyllisstein opened this issue Jul 15, 2017 · 3 comments

Comments

@phyllisstein
Copy link
Contributor

👋 I've been working on bootstrapping a new repo with your new universal family and running into some trouble with CSS hot reloading. Hot updates are applied, but they appear earlier in the cascade than the original styles and are consequently overridden by the CSS they're meant to replace. Here, I've changed the h1's color from red to blue; you can see that the new style is loaded, but not applied:

screen shot 1

Just curious whether you'd seen anything like this before. If it helps, there's a small amount of code at https://github.com/ignota/ignota2 that shows what I think should work. (Frustratingly, it's largely pulled from another repo where CSS HMR is working, and I can't account for the difference. 😡 )

Thanks in advance for any thoughts you might have!

@phyllisstein
Copy link
Contributor Author

React Router was blocking updates on re-render. Adding the withRouter decorator to my App component did the job!

@phyllisstein
Copy link
Contributor Author

...but not for CSS updates, just for React updates. 😬

@phyllisstein
Copy link
Contributor Author

Looks like the old sheets aren't being removed because the logic for choosing the correct <link> tag is a little off. It's grabbing my favicon rather than the CSS link. Gonna see if I can tweak and patch it.

screen shot

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

1 participant