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

Remove dependency on react router from error handler #1338

Merged
merged 1 commit into from
Dec 9, 2024

Conversation

syucream
Copy link
Contributor

@syucream syucream commented Dec 7, 2024

useNavigate() should be called within react router Router context, but the ErrorHandler will not follow. So I remove dependency on the library from the component.

Currently the component doesn't work correctly:

router.js:284 Uncaught Error: useNavigate() may be used only in the context of a <Router> component.
    at invariant (router.js:284:11)
    at useNavigateUnstable (index.js:262:102)
    at useNavigate (index.js:259:46)
    at GenericError (ErrorHandler.tsx:64:55)

Copy link
Contributor

@hinashi hinashi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Member

@userlocalhost userlocalhost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much for fixing it 👍

@userlocalhost userlocalhost merged commit 9a1d61c into dmm-com:master Dec 9, 2024
3 checks passed
@userlocalhost userlocalhost deleted the fix/error-handler branch December 9, 2024 07:12
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.

3 participants