File tree Expand file tree Collapse file tree 1 file changed +24
-13
lines changed Expand file tree Collapse file tree 1 file changed +24
-13
lines changed Original file line number Diff line number Diff line change 1- import type { ReactElement } from 'react' ;
1+ import { type ReactElement , useCallback } from 'react' ;
22import {
3- BottomSheetScrollView ,
43 type BottomSheetScrollableProps ,
4+ BottomSheetScrollView ,
55} from '../components/bottomSheetScrollable' ;
66
77type BottomSheetScrollableCreatorConfigs = { } & BottomSheetScrollableProps ;
@@ -34,16 +34,27 @@ export function useBottomSheetScrollableCreator<T = any>({
3434 focusHook,
3535 scrollEventsHandlersHook,
3636 enableFooterMarginAdjustment,
37- } : BottomSheetScrollableCreatorConfigs = { } ) : ( props : T ) => ReactElement < T > {
38- // @ts -ignore
39- return ( { data : _ , ...props } : T , ref : never ) => (
40- // @ts -ignore
41- < BottomSheetScrollView
42- ref = { ref }
43- { ...props }
44- focusHook = { focusHook }
45- scrollEventsHandlersHook = { scrollEventsHandlersHook }
46- enableFooterMarginAdjustment = { enableFooterMarginAdjustment }
47- />
37+ } : BottomSheetScrollableCreatorConfigs = { } ) : (
38+ props : T ,
39+ ref ?: never
40+ ) => ReactElement < T > {
41+ return useCallback (
42+ function useBottomSheetScrollableCreator (
43+ // @ts -expect-error
44+ { data : _ , ...props } : T ,
45+ ref ?: never
46+ ) : ReactElement < T > {
47+ return (
48+ // @ts -expect-error
49+ < BottomSheetScrollView
50+ ref = { ref }
51+ { ...props }
52+ focusHook = { focusHook }
53+ scrollEventsHandlersHook = { scrollEventsHandlersHook }
54+ enableFooterMarginAdjustment = { enableFooterMarginAdjustment }
55+ />
56+ ) ;
57+ } ,
58+ [ focusHook , scrollEventsHandlersHook , enableFooterMarginAdjustment ]
4859 ) ;
4960}
You can’t perform that action at this time.
0 commit comments