Skip to content

Commit b53b8ef

Browse files
authored
[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 7b2c35d commit b53b8ef

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
@@ -282,7 +282,7 @@ export function isRNSVGElement(viewRef: SVGRef | GestureHandlerRef) {
282282
export function isRNSVGNode(node: any) {
283283
// If `ref` has `rngh` field, it means that component comes from Gesture Handler. This is a special case for
284284
// `Text` component, which is present in `RNSVGElements` set, yet we don't want to treat it as SVG.
285-
if (node.ref?.rngh) {
285+
if (node.props.ref?.rngh) {
286286
return false;
287287
}
288288

0 commit comments

Comments
 (0)