Skip to content

Give loadingStatus as an input into the function for container #208

@eedrah

Description

@eedrah

This will allow people to render different things depending on if the component is still in the loading stage, the unloading stage, or the loaded stage.

A boolean won't work, as there are 3 states, so I was thinking 1 for when it is loading, 0 for when it has loaded successfully, and -1 for when it is showing the "unloader". This will allow logic to fit into trinaries easy. For example, (children, loadingStatus) => loadingStatus ? children : "Image has loaded and been cached!" will show the loader and unloader as normal, and will show the sentence if successful.

I'll go ahead and do a pull request, but I'm open to more discussion if people want to change the specifics.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions