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

Wrap safeToRemove function with useCallback hook #2431

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

baeharam
Copy link

@baeharam baeharam commented Dec 1, 2023

Why?

Most React users use lint for hook which shows error when deps of useEffect is missed. So, safeToRemove function need to be inserted into useEffect when using useAnimate hook. Even if framer guide shows example code that is not including safeToRemove into deps of useEffect, react user want to solve lint error.

Solution

Therefore, safeToRemove should ensure that it keeps reference of same function in same component. If this is intended implementation, I would appreciate it if you explain the reason.

Thanks for reading and your great library!

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

1 participant