How does glamor work with SPA?
Closed this issue · 2 comments
vkbansal commented
Continuing discussion from:
https://twitter.com/threepointone/status/865900719261364225
I have few question regarding glamor with respect to SPAs (some of them may sound stupid)
- As far as I understand, while navigating from
PageA
toPageB
(using something likereact-router
), the styles fromPapeB
would get appended and so on so forth. Would this impact performance? - Is there a chance for FOUT between page transitions (specifically first time) while using code-splitting based on routes?
threepointone commented
- Nope, you should be fine. Glamor handles deduping, fast style insertion via insertRule in prod, etc.
- Nope, should be fine. Glamor operates syncly, so the rules are available before the dom nodes are on the page. The exception is SSR stuff, for which you'll need to insert rules in head via https://github.com/threepointone/glamor/blob/master/docs/server.md
threepointone commented
Closing, feel free to continue conversation