From b5294458516e12359a198a12b92a48a1af42b4c9 Mon Sep 17 00:00:00 2001 From: Emma Date: Wed, 4 Sep 2024 04:28:57 -0600 Subject: [PATCH] changes schema editor to jotai --- components/schema/field-type-input.tsx | 6 ++- components/schema/index.tsx | 21 ++++---- components/schema/template-editor.tsx | 68 ++++++++++++++------------ recoil/atoms/schema.ts | 15 ++++-- types.d.ts | 4 +- 5 files changed, 67 insertions(+), 47 deletions(-) diff --git a/components/schema/field-type-input.tsx b/components/schema/field-type-input.tsx index ee42b7d..baa30d8 100644 --- a/components/schema/field-type-input.tsx +++ b/components/schema/field-type-input.tsx @@ -1,14 +1,16 @@ -import { useRecoilValue } from "recoil"; +// import { useRecoilValue } from "recoil"; import { SchemaEditAtom } from "../../recoil/atoms/schema"; import { TEMPLATE_TYPES } from "../../constants/TemplateTypes"; import { FC, PropsWithChildren } from "react"; +import { useAtom } from "jotai"; interface IProps { bind: InputBinder; } export const FieldTypeInput: FC> = ({ bind }) => { - const schema = useRecoilValue(SchemaEditAtom); + // const schema = useRecoilValue(SchemaEditAtom); + const [schema] = useAtom(SchemaEditAtom); return (