Component CSS and JavaScript always loading #70
-
Hey gang, I'm running into some unexpected behavior whereby component CSS and JavaScript is always being loaded even if the component is not being used on the page. In fact it's injecting these into every page of my app. When I remove the Any thoughts on how I might go about tracking down this issue? My version is |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 9 replies
-
Oh, that's missing documentation, sorry about that. You need to add 'django_components.middleware.ComponentDependencyMiddleware' to your MIDDLEWARE section too, that's the thing that makes smarter choices of where to import CSS and JS. I'll create an issue about adding docs for this. |
Beta Was this translation helpful? Give feedback.
Using this in the settings of project solves it.
COMPONENTS = { 'RENDER_DEPENDENCIES': True }