-
-
Notifications
You must be signed in to change notification settings - Fork 986
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
gestureHandlerRootHOC forces reload every time on iOS #2685
Comments
Hey! 👋 The issue doesn't seem to contain a minimal reproduction. Could you provide a snack or a link to a GitHub repository under your username that reproduces the problem? |
Could you check whether const GestureEnabledChatChannelScreen = gestureHandlerRootHOC(ChatChannelScreen);
<Stack.Screen
name="/chats/channel"
options={{
title: 'Chat',
headerShown: true,
}}
component={GestureEnabledChatChannelScreen}
/> works as expected? It's likely caused by the function being called on every render and returning a newly created component every time. |
strange, but that appears to have fixed it...can you explain why? is the true issue coming from |
It's not an issue actually, but the expected behavior.
When you first assign the result of |
Description
I was trying to understand why my component was reloading every time I came back from a background state on iOS and I found out it was this code
gestureHandlerRootHOC
...if I remove it suddenly there is no refresh.According to the docs it should just be a no-op on iOS...it however seems to actually be doing more than just that. I can't remember why I switched from the root level to this but I think it was to fix some issue.
Anyway, what can I do to fix this?
Steps to reproduce
Snack or a link to a repository
https://stackoverflow.com/help/mcve
Gesture Handler version
2.13.4
React Native version
0.72
Platforms
iOS
JavaScript runtime
Hermes
Workflow
React Native (without Expo)
Architecture
Paper (Old Architecture)
Build type
Debug mode
Device
iOS simulator
Device model
No response
Acknowledgements
Yes
The text was updated successfully, but these errors were encountered: