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 {
37
37
wrapperViewRefAtom ,
38
38
} from './state' ;
39
39
import { useKeyboard } from './useKeyboard' ;
40
+ import { createStore } from 'jotai' ;
40
41
41
42
const isAndroid = Platform . OS === 'android' ;
42
43
@@ -68,9 +69,13 @@ const styles = StyleSheet.create({
68
69
} ,
69
70
} ) ;
70
71
72
+ const store = createStore ( ) ;
73
+
74
+ store . set ( inputsAtom , { } ) ;
75
+
71
76
export default function SmartScrollView ( props : PropsWithChildren < { } > ) {
72
77
return (
73
- < JotaiProvider >
78
+ < JotaiProvider store = { store } >
74
79
< Wrapper { ...props } />
75
80
</ JotaiProvider >
76
81
) ;
@@ -127,7 +132,7 @@ export function useFormSmartScroll({
127
132
const _keyboard = useKeyboard ( ) ;
128
133
129
134
const setState = useSetAtom ( elementsAtom ) ;
130
- const [ inputs , setInputs ] = useAtom ( inputsAtom ) ;
135
+ const [ inputs , setInputs ] = useAtom ( inputsAtom , { store } ) ;
131
136
132
137
const currentFocus = useAtomValue ( currentFocusAtom ) ;
133
138
You can’t perform that action at this time.
0 commit comments