Skip to content

Value of load never changes #35

@allroundexperts

Description

@allroundexperts

We're facing an issue where if the hook un-mounts before the onload handler being called, the value of load remains true indefinitely. This makes sense if you read through the code as well.

If the component un-mounts before the handler given here gets called:
https://github.com/hupe1980/react-script-hook/blob/master/src/use-script.tsx#L111
then the load value will always remain true even on subsequent mounts because the script has been loaded and we removed the event listener for load before it could be fired. This is causing our E2E tests to break intermittently.

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