Skip to content

Changes the behavior of initial loading state.#25

Open
radfahrer wants to merge 1 commit intohupe1980:masterfrom
radfahrer:master
Open

Changes the behavior of initial loading state.#25
radfahrer wants to merge 1 commit intohupe1980:masterfrom
radfahrer:master

Conversation

@radfahrer
Copy link

When using the checkForExisting option, start the loading state as false and only set loading to true if the script does not already exist.

Resolves #24

When using the `checkForExisting` option.

Resolves hupe1980#24
@radfahrer
Copy link
Author

@hupe1980 I just wanted to reach out to see if you have seen this PR. If you haven't had time to review it, I understand. Let me know if there's anything you need from me.

@hupe1980
Copy link
Owner

What kind of error do you have exactly?
We actually have to return loading = true until we are sure that the script has been loaded.

@woojunro
Copy link

In my opinion, the original code is reasonable since loading state should be true until useEffect checks if the script already exists and ensures the script is loaded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The loading value comes back true when the script already exists.

3 participants