Skip to content

Garbage collection/stale styles #387

@timothympace

Description

@timothympace

I was wondering if there is any notion of garbage collection in Aphrodite. When a component unmounts, and it's styles are no longer being used, is it possible to clean up just that components styles? I ask because I have a specific component that can end up generating a lot of different styles over it's lifetime.

I also noticed there is a resetInjectedStyle method, but it looks like it just resets the internal keys of which classnames have already been injected into the style tag. Maybe there could be another function that does a little more? When I saw this function I expected it to completely remove all styles for the passed in className. Is there any way to do that?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions