-
-
Notifications
You must be signed in to change notification settings - Fork 5k
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 #10834
feat: add freezeOnBlur prop #10834
Conversation
✅ Deploy Preview for react-navigation-example ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
The Expo app for the example from this branch is ready! expo.dev/@react-navigation/react-navigation-example?release-channel=pr-10834 |
Codecov Report
@@ Coverage Diff @@
## main #10834 +/- ##
=======================================
Coverage 74.91% 74.91%
=======================================
Files 167 167
Lines 5130 5130
Branches 1986 1986
=======================================
Hits 3843 3843
Misses 1248 1248
Partials 39 39
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
as these props will be added in the next screens version
Hey thank you for this awesome property! I wonder, why this does not freeze the second most-top screen in a stack navigator?
Is there a way to configure the freeze so it freezes all non-active screens in the stack navigator? |
Hey! This issue is closed and isn't watched by the core team. You are welcome to discuss the issue with others in this thread, but if you think this issue is still valid and needs to be tracked, please open a new issue with a repro. |
Motivation
Since version v3.9.0
react-native-screens
exposedenableFreeze()
function which allows to suspend all hidden screens from rendering with the use ofreact-freeze
library.This PR adds a new prop called
freezeOnBlur
which makes it possible to decide per screen which screen should be suspended from rendering.Test plan
This feature needs
react-native-screens
with version >=3.16 so as of today we're not able to test this prop within Expo Go.Update screens to the newest version
yarn up react-native-screens
Run example in bare-workflow
yarn example ios
yarn example android
Use code samples below to test the feature
Only a visible screen should
console.log
in native-stack.In stack, two top-most screens should
console.log
.Code example for Stack and Native-Stack
Only a visible screen should
console.log
Code example for BottomTab and Drawer navigator
Static