Skip to content

Commit b906f5e

Browse files
fix: replace getRefNativeTag with findNodeHandle (#1823)(by @AndreiCalazans)
1 parent 6b99810 commit b906f5e

File tree

3 files changed

+4
-47
lines changed

3 files changed

+4
-47
lines changed

src/hooks/useScrollable.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { useCallback, RefObject, useRef } from 'react';
2+
import { findNodeHandle } from 'react-native';
23
import { useSharedValue } from 'react-native-reanimated';
3-
import { getRefNativeTag } from '../utilities/getRefNativeTag';
44
import { SCROLLABLE_STATE, SCROLLABLE_TYPE } from '../constants';
55
import type { ScrollableRef, Scrollable } from '../types';
66

@@ -38,7 +38,7 @@ export const useScrollable = () => {
3838
// find node handle id
3939
let id;
4040
try {
41-
id = getRefNativeTag(ref);
41+
id = findNodeHandle(ref.current);
4242
} catch {
4343
return;
4444
}

src/hooks/useScrollableSetter.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React, { useCallback, useEffect } from 'react';
2+
import { findNodeHandle } from 'react-native';
23
import Animated from 'react-native-reanimated';
34
import { useBottomSheetInternal } from './useBottomSheetInternal';
4-
import { getRefNativeTag } from '../utilities/getRefNativeTag';
55
import { SCROLLABLE_TYPE } from '../constants';
66
import type { Scrollable } from '../types';
77

@@ -31,7 +31,7 @@ export const useScrollableSetter = (
3131
isContentHeightFixed.value = false;
3232

3333
// set current scrollable ref
34-
const id = getRefNativeTag(ref);
34+
const id = findNodeHandle(ref.current);
3535
if (id) {
3636
setScrollableRef({
3737
id: id,

src/utilities/getRefNativeTag.ts

Lines changed: 0 additions & 43 deletions
This file was deleted.

0 commit comments

Comments
 (0)