Skip to content

Commit 51c5a8c

Browse files
rmarquoisj-piasecki
authored andcommitted
[Web] Fixed Accessing element.ref was removed in React 19 error (#3804)
## Description Since version 19, React doesn't allow direct access to ref from an element. This error occurs when using React Native Gesture Handler on web. ## Test plan Tested my fix in my web project and error in console disappears.
1 parent 46bc3c8 commit 51c5a8c

File tree

1 file changed

+1
-1
lines changed
  • packages/react-native-gesture-handler/src/web

1 file changed

+1
-1
lines changed

packages/react-native-gesture-handler/src/web/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ export function isRNSVGElement(viewRef: SVGRef | GestureHandlerRef) {
278278
export function isRNSVGNode(node: any) {
279279
// If `ref` has `rngh` field, it means that component comes from Gesture Handler. This is a special case for
280280
// `Text` component, which is present in `RNSVGElements` set, yet we don't want to treat it as SVG.
281-
if (node.ref?.rngh) {
281+
if (node.props.ref?.rngh) {
282282
return false;
283283
}
284284

0 commit comments

Comments
 (0)