Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: output an error when useMap is called outside APIProvider #117

Merged
merged 1 commit into from
Dec 1, 2023

Conversation

usefulthink
Copy link
Collaborator

@usefulthink usefulthink commented Dec 1, 2023

When used outside the APIProvider the useMap() and all dependent hooks would just silently fail and never return anything.

For a better developer experience, we will now log an error to the console when the useMap() hook is called from a component outside the APIProvider hierarchy.

closes #112

When used outside the APIProvider the useMap() and all dependent hooks would just silently fail and never return anything.

For a better developer experience, we will now log an error to the console when the `useMap()` hook is called from a component outside the APIProvider hierarchy.
@usefulthink usefulthink merged commit 5c30c3d into visgl:main Dec 1, 2023
2 checks passed
@usefulthink usefulthink deleted the fix/use-map-context-error branch December 1, 2023 15:23
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.

[Feat] useMap should log an error when used outside the APIProvider context
1 participant