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: memoize onExitComplete handler #2802

Merged

Conversation

custardcream98
Copy link
Contributor

@custardcream98 custardcream98 commented Sep 14, 2024

onExitComplete is recreated every time the parent component rerenders when the presenceAffectsLayout prop of AnimatePresence is set to true, which unnecessarily recreates the safeToRemove callback.

closes #2801

@custardcream98 custardcream98 force-pushed the fix/safeToRemove-prevent-recreated branch from d7798c1 to 41f2ff7 Compare September 14, 2024 19:05
@custardcream98 custardcream98 changed the title fix: remove unnecessary dependency from safeToRemove callback fix: memoize onExitComplete handler Sep 14, 2024
@mattgperry
Copy link
Collaborator

Thanks for the PR!

@mattgperry mattgperry merged commit 6b27a80 into framer:main Oct 8, 2024
1 check passed
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.

[BUG] safeToRemove Callback Recreated on Parent Re-render
2 participants