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: wrap react hooks with useMemo; useCallback #147

Merged
merged 1 commit into from
Feb 27, 2024

Conversation

VriskaSerket51
Copy link
Contributor

Currently, useNavigate and useModals create new instance every renders.
This will cause infinite loop when someone uses hooks like:

const navigate = useNavigate();
useEffect(() => {
    // do something when path change or anything
}, [navigate]);

By wrapping hooks with React.useMemo and React.useCallback, they will not create new one each render.

@VriskaSerket51 VriskaSerket51 changed the title Wrap react hooks with useMemo; useCallback fix: wrap react hooks with useMemo; useCallback Feb 21, 2024
@oedotme
Copy link
Owner

oedotme commented Feb 27, 2024

@VriskaSerket51 Thanks for those updates!

@oedotme oedotme merged commit efc3868 into oedotme:main Feb 27, 2024
@oedotme
Copy link
Owner

oedotme commented Feb 27, 2024

Released at v1.18.4

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.

2 participants