File tree Expand file tree Collapse file tree 4 files changed +7
-50
lines changed Expand file tree Collapse file tree 4 files changed +7
-50
lines changed Original file line number Diff line number Diff line change 11import { useEffect , useRef , TouchEvent } from 'react' ;
2+ import { findNodeHandle } from 'react-native' ;
23import { useSharedValue } from 'react-native-reanimated' ;
34import { useBottomSheetInternal } from './useBottomSheetInternal' ;
45import { ANIMATION_STATE , SCROLLABLE_STATE } from '../constants' ;
5- import { getRefNativeTag } from '../utilities/getRefNativeTag' ;
66import type { Scrollable } from '../types' ;
77
88export type ScrollEventContextType = {
@@ -12,7 +12,7 @@ export type ScrollEventContextType = {
1212
1313export const useScrollHandler = ( ) => {
1414 //#region refs
15- const scrollableRef = useRef < Scrollable > ( ) ;
15+ const scrollableRef = useRef < Scrollable > ( null ) ;
1616 //#endregion
1717
1818 //#region variables
@@ -29,7 +29,7 @@ export const useScrollHandler = () => {
2929
3030 //#region effects
3131 useEffect ( ( ) => {
32- const element = getRefNativeTag ( scrollableRef ) as any ;
32+ const element = findNodeHandle ( scrollableRef . current ) as any ;
3333
3434 var scrollOffset = 0 ;
3535 var supportsPassive = false ;
Original file line number Diff line number Diff line change 11import { useCallback , RefObject , useRef } from 'react' ;
2+ import { findNodeHandle } from 'react-native' ;
23import { useSharedValue } from 'react-native-reanimated' ;
3- import { getRefNativeTag } from '../utilities/getRefNativeTag' ;
44import { SCROLLABLE_STATE , SCROLLABLE_TYPE } from '../constants' ;
55import 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 }
Original file line number Diff line number Diff line change 11import React , { useCallback , useEffect } from 'react' ;
2+ import { findNodeHandle } from 'react-native' ;
23import Animated from 'react-native-reanimated' ;
34import { useBottomSheetInternal } from './useBottomSheetInternal' ;
4- import { getRefNativeTag } from '../utilities/getRefNativeTag' ;
55import { SCROLLABLE_TYPE } from '../constants' ;
66import 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 ,
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments