Handling invalid token error #2414
Unanswered
JoseLuisGJ
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi there 👋 I'm trying to handle the error when an invalid token is provided to the
<Map/>
component.If I provide an invalid token the App crashes and it's a mess. I was wondering if that's something feasible. For now I was trying to capture errors using
onError={evt => console.error(evt.error)}
but it doesn't triggers the error to handle it and avoid the crass.It works providing a new token knowing that the
mapboxAccessToken
prop is not reactive I rerender the component with the new value if the token exists. But the problem comes when a user provides a token with a typo or starts typing random text like in the example above.Any idea? thanks.
Beta Was this translation helpful? Give feedback.
All reactions