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 }) => {
162
162
163
163
export const useSmartScrollContext = ( ) => {
164
164
const context = React . useContext ( SmartScrollContext ) ;
165
+ const scrollY = useSharedValue ( 0 ) ;
166
+ const wrapperRef = React . useRef < View > ( null ) ;
167
+ const scrollRef = useAnimatedRef < Animated . ScrollView > ( ) ;
165
168
166
169
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
+ } ;
170
184
}
171
185
172
186
return context ;
Original file line number Diff line number Diff line change @@ -9,5 +9,5 @@ export const MagicScroll = {
9
9
ViewWrapper,
10
10
TextInput,
11
11
withSmartScroll,
12
- SmartScrollView,
12
+ ChainingProvider : SmartScrollView ,
13
13
} ;
You can’t perform that action at this time.
0 commit comments