From 247785b97cb582203a124b4323a4189432378d2a Mon Sep 17 00:00:00 2001 From: Miroslav Petrik Date: Mon, 4 Mar 2024 16:01:59 +0100 Subject: [PATCH] fix: export & name atom thank you typescript --- src/atoms/list-atom/listItemForm.ts | 4 ++-- src/components/index.ts | 1 + src/index.ts | 1 - 3 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 src/components/index.ts diff --git a/src/atoms/list-atom/listItemForm.ts b/src/atoms/list-atom/listItemForm.ts index c939408..e271189 100644 --- a/src/atoms/list-atom/listItemForm.ts +++ b/src/atoms/list-atom/listItemForm.ts @@ -158,7 +158,7 @@ export function listItemForm({ ); // @ts-expect-error field is PrimitiveAtom - set(field, { name: scopedNameAtom, originalFieldNameAtom, ...atoms }); + set(field, { ...atoms, name: scopedNameAtom, originalFieldNameAtom }); }); return () => { @@ -168,10 +168,10 @@ export function listItemForm({ // @ts-expect-error field is PrimitiveAtom set(field, { + ...atoms, // drop the scopedNameAtom, as to not make it original on next mount name: originalFieldNameAtom, originalFieldNameAtom: undefined, - ...atoms, }); }); }; diff --git a/src/components/index.ts b/src/components/index.ts new file mode 100644 index 0000000..491ccf0 --- /dev/null +++ b/src/components/index.ts @@ -0,0 +1 @@ +export * from "./list"; diff --git a/src/index.ts b/src/index.ts index b0ca30e..ae87140 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,4 +1,3 @@ export * from "./atoms"; export * from "./components"; -export * from "./fields"; export * from "./hooks";