File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ import {
3737 wrapperViewRefAtom ,
3838} from './state' ;
3939import { useKeyboard } from './useKeyboard' ;
40+ import { createStore } from 'jotai' ;
4041
4142const isAndroid = Platform . OS === 'android' ;
4243
@@ -68,9 +69,13 @@ const styles = StyleSheet.create({
6869 } ,
6970} ) ;
7071
72+ const store = createStore ( ) ;
73+
74+ store . set ( inputsAtom , { } ) ;
75+
7176export default function SmartScrollView ( props : PropsWithChildren < { } > ) {
7277 return (
73- < JotaiProvider >
78+ < JotaiProvider store = { store } >
7479 < Wrapper { ...props } />
7580 </ JotaiProvider >
7681 ) ;
@@ -127,7 +132,7 @@ export function useFormSmartScroll({
127132 const _keyboard = useKeyboard ( ) ;
128133
129134 const setState = useSetAtom ( elementsAtom ) ;
130- const [ inputs , setInputs ] = useAtom ( inputsAtom ) ;
135+ const [ inputs , setInputs ] = useAtom ( inputsAtom , { store } ) ;
131136
132137 const currentFocus = useAtomValue ( currentFocusAtom ) ;
133138
You can’t perform that action at this time.
0 commit comments