File tree Expand file tree Collapse file tree 2 files changed +18
-4
lines changed Expand file tree Collapse file tree 2 files changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -162,11 +162,25 @@ const SmartScrollProvider = ({ children }: { children: React.ReactNode }) => {
162162
163163export const useSmartScrollContext = ( ) => {
164164 const context = React . useContext ( SmartScrollContext ) ;
165+ const scrollY = useSharedValue ( 0 ) ;
166+ const wrapperRef = React . useRef < View > ( null ) ;
167+ const scrollRef = useAnimatedRef < Animated . ScrollView > ( ) ;
165168
166169 if ( ! context ) {
167- throw new Error (
168- 'Component must be wrapped in a SmartScrollProvider. Please ensure the provider is included.'
169- ) ;
170+ return {
171+ scrollRef,
172+ scrollY : scrollY ,
173+ isReady : false ,
174+ wrapperRef,
175+ wrapperOffset : 0 ,
176+ setWrapperOffset : ( ) => null ,
177+ elements : { } ,
178+ setElements : ( ) => null ,
179+ inputs : { } ,
180+ setInputs : ( ) => null ,
181+ currentFocus : undefined ,
182+ clearFocus : ( ) => null ,
183+ } ;
170184 }
171185
172186 return context ;
Original file line number Diff line number Diff line change @@ -9,5 +9,5 @@ export const MagicScroll = {
99 ViewWrapper,
1010 TextInput,
1111 withSmartScroll,
12- SmartScrollView,
12+ ChainingProvider : SmartScrollView ,
1313} ;
You can’t perform that action at this time.
0 commit comments