-
-
Notifications
You must be signed in to change notification settings - Fork 518
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
feat: add freezeOnBlur prop to enable/disable freeze per navigator & per screen #1538
Conversation
Thanks @janicduplessis! 🏅 I've renamed the props and added a way to disable freeze per navigator. |
After a discussion with @WoLewicki and @satya164 I've decided to drop the option on the navigator and unify the logic under one Gonna add this to all navigators in |
@kacperkapusciak Thanks, sounds good. I was also planning to add it to @react-navigation, I should be able to do it in the next few days. |
After back and forth discussions we've decided to remove the With the introduction of this PR and the implementation of if (enabled) {
return <DelayedFreeze freeze={freeze}>{children}</DelayedFreeze>;
} else {
return <>{children}</>;
} On the other hand, a bare Freeze component coming from Remounting the whole React tree is way worse than wrapping every screen with an (almost) empty |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Description
We have a use case where we'd like to disable freeze for a particular screen. This adds a prop to allow setting if freeze is enabled on a per screen basis.
Changes
Added a
freezeOnBlur
prop to theScreen
component.Test code and steps to reproduce
Tested in an app that it is now possible to disable freeze for a particular screen and that previous behavior is kept if no prop is passed.
In repo: TestsExample/src/TestFreeze.tsx
Checklist