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: firefox/safari to redirect to /explore in HomeLayout #3001

Merged
merged 1 commit into from Feb 26, 2024

Conversation

zhzy0077
Copy link
Contributor

Problem:
For browsers not support ViewTransition API | Can I use... Support tables for HTML5, CSS3, etc, majorly Firefox and Safari, useNavigateTo(useNavigateTo.ts) calls useNavigate immediately, and it works in most cases except in HomeLayout.tsx.

An error shows You should call navigate() in a React.useEffect(), not when your component is first rendered.

Cause:
Regressed by this PR: chore: tweak route layout · usememos/memos@dfe29ec

Fix:
Follow the correct pattern to call useNavigate inside of an useEffect hook.

Copy link
Collaborator

@boojack boojack left a comment

Choose a reason for hiding this comment

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

LGTM, good catch

@boojack boojack merged commit 51a7934 into usememos:main Feb 26, 2024
5 checks passed
@zhzy0077 zhzy0077 deleted the patch branch February 26, 2024 05:42
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.

None yet

2 participants