Skip to content

Commit 00d7f0c

Browse files
committed
fix(chainable): fix issue with chainable
1 parent 311c568 commit 00d7f0c

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/Provider.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ import {
3737
wrapperViewRefAtom,
3838
} from './state';
3939
import { useKeyboard } from './useKeyboard';
40+
import { createStore } from 'jotai';
4041

4142
const 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+
7176
export 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

0 commit comments

Comments
 (0)