Closed unbiased-dev closed 11 months ago
See previous issues - for example #2783. This is the intended behavior. It's not worth it to count how many instances of a component exist so we can unload their styles. Global styles that are loaded as part of a particular component are a bad idea generally.
@Conduitry So how does one style the body tag only on certain routes without using global?
@Conduitry how can a resource leak be intended behaviour?
Describe the bug
If you have a route with global styling, it is injected into the head when you navigate to it. That's good. Navigate back and the global from the nested route is not unloaded.
Even worse, hovering on a URL by default is preloading the route. Good. This also fetches the global styling and injects it. Not that good.
Reproduction