Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## 馃摐 Description Do not use `target` property from `onLayout`. ## 馃挕 Motivation and Context In continuation of facebook/react-native#42785 it seems like `target` property is not documented and thus can be removed at any point of time so it's simply not reliable to use it since the code can be easily broken in newest RN versions. So in this PR I started to use `findNodeHandle` and pass a `ref` to get a view target. Initially I thought that it'll throw a warning in strict mode, but it looks like this method will throw a warning only if `findNodeHandle(component)` statement is used. And since I'm passing a `ref` - it's safe to use such code. Also I'm still getting `target` property in `onLayout`. Maybe more optimized version would be to derive a `target` property in `onRef` handler, but it's further improvements/optimizations (we need to make changes gradually). ## 馃摙 Changelog <!-- High level overview of important changes --> <!-- For example: fixed status bar manipulation; added new types declarations; --> <!-- If your changes don't affect one of platform/language below - then remove this platform/language --> ### JS - use `findNodeHandle` in `onLayout` instead of `target` property from event; ## 馃 How Has This Been Tested? Tested paper & Fabric on iOS 17.2 (iPhone 15 simulator). ## 馃摑 Checklist - [x] CI successfully passed - [x] I added new mocks and corresponding unit-tests if library API was changed
- Loading branch information