Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update view tag on
componentDidUpdate
(software-mansion#4440)
<!-- Thanks for submitting a pull request! We appreciate you spending the time to work on these changes. Please follow the template so that the reviewers can easily understand what the code changes affect. --> ## Summary <!-- Explain the motivation for this PR. Include "Fixes #<number>" if applicable. --> Fixes software-mansion#3769 Each time `componentDidUpdate` is triggered we have to subscribe for events again. However we used to use the same viewTag, although the viewTag may change each time the view is updated. This mean that the given view will stop receiving any events. Look at the above-linked issue to see the description of bug in the recordings. In the console you can see viewTag used to subscribe for events. In a buggy example it doesn't change when you modify the orientation of the scroll. <table> <tr><td>BEFORE</td><td> https://github.com/software-mansion/react-native-reanimated/assets/56199675/e8db724a-620f-4da1-ac44-bdc73e4d936b </td></tr> <tr><td>AFTER</td><td> https://github.com/software-mansion/react-native-reanimated/assets/56199675/b2a8d2c1-0476-4ddf-b543-b7c0b768389e </td></tr> </table> ## Test plan <!-- Provide a minimal but complete code snippet that can be used to test out this change along with instructions how to run it and a description of the expected behavior. --> Tested on example from the issue: https://snack.expo.dev/fTGYvJ2t5 Co-authored-by: Aleksandra Cynk <aleksandracynk@swmansion.com>
- Loading branch information