[0.77] getBoundingClientRect
TypeScript type definition missing on View with New Architecture
#50684
Labels
Issue: Author Provided Repro
This issue can be reproduced in Snack or an attached project.
Newer Patch Available
Type: New Architecture
Issues and PRs related to new architecture (Fabric/Turbo Modules)
Description
With the introduction of New Architecture and
useLayoutEffect
, we can now read layout synchronously withref.current?.getBoundingClientRect
.However, the TypeScript definition for
NativeMethods
does not yet include the newly supported method.Steps to reproduce
Check the definition of
NativeMethods
inreact-native/types/public/ReactNativeTypes.d.ts
, note thatgetBoundingClientRect
is missing.React Native Version
0.77.1
Affected Platforms
Build - MacOS
Areas
Other (please specify)
Output of
npx @react-native-community/cli info
Stacktrace or Logs
Reproducer
https://github.com/bryanmylee/missing-types-new-arch-native-methods
Screenshots and Videos
I've searched for any mention of this all over but can't find anything, and the documentation barely makes a mention of
getBoundingClientRect
.This appears to be the most valid channel to report this bug, however this does not produce a stacktrace or reproducer, so I'm happy to move this elsewhere if necessary.
The text was updated successfully, but these errors were encountered: