cherry-pick(4.3-stable): animated host lookup fixes (#9589, #9680) + discovery example fix (#9733)#9737
Open
MatiPl01 wants to merge 3 commits into
Open
cherry-pick(4.3-stable): animated host lookup fixes (#9589, #9680) + discovery example fix (#9733)#9737MatiPl01 wants to merge 3 commits into
MatiPl01 wants to merge 3 commits into
Conversation
## Summary Fixes #9587. When `findHostInstance_DEPRECATED` is needed, Reanimated currently falls back to resolving the animated wrapper instance unless the component used `getAnimatableRef`. That can target the outer host view for components that forward their `ref` to an inner host view. This change prefers the resolved `_componentRef` whenever it is available, preserving the existing fast path while making the deprecated lookup follow the same ref target that `createAnimatedComponent` captured. ## Test plan ```sh yarn workspace react-native-reanimated test findHostInstance.test.ts --runInBand yarn eslint packages/react-native-reanimated/src/platform-specific/findHostInstance.ts packages/react-native-reanimated/__tests__/findHostInstance.test.ts git diff --check ``` --------- Co-authored-by: Mateusz Łopaciński <lop.mateusz.2001@gmail.com>
…86 (#9680) ## Summary [#9589](#9589) renamed the native-ref check from `_viewConfig` to `__viewConfig`. Renderers older than RN 0.86 (e.g. react-native-macos 0.81) only expose `_viewConfig`, so the fast path missed and `findHostInstance_DEPRECATED` threw `Argument appears to not be a ReactComponent` for every animated component. This accepts either key (`__viewConfig` first, `_viewConfig` fallback); RN 0.86+ is unaffected.
## Summary 🚀 ## Test plan
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Cherry-picking for Reanimated 4.3.2 release. #9680 depends on #9589, and #9733 fixes the
InstanceDiscoveryexample that #9589 brings in (it threw on mount), so all three are included in this single PR (cherry-picked in order)._viewConfigin animated host lookup for RN < 0.86 #9680