Fix relations not working when one of the child dependencies remounts without a render in the parent #3269
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Fixes #3265
As @gaearon pointed out in the issue:
That's unfortunately true, and the current API doesn't allow to use ref callbacks to handle this (nor would it be easy to update it to do that). This is one more point to the pile of reasons why the API needs an overhaul.
For the time being, I implemented a mechanism that allows
GestureDetector
to listen to the mounting and unmounting of gestures. This way it can react to a remount of a gesture it depends on and update the native side if necessary.Test plan
Tested on the Example app and the reproducer from the issue
Screen.Recording.2024-12-09.at.12.23.28.mov
Screen.Recording.2024-12-09.at.12.14.50.mov