From d99adaf329247bf5d58cfdfdd663ec458168faa7 Mon Sep 17 00:00:00 2001 From: Oleg Isonen Date: Sat, 20 Aug 2022 09:05:50 +0300 Subject: [PATCH] fix types, enable async imports in ts --- .../features/wrapper-component/text-editor/editor.tsx | 4 ++-- .../features/wrapper-component/text-editor/lazy-editor.tsx | 7 ++++--- packages/tsconfig/remix.json | 5 +++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/apps/designer/app/canvas/features/wrapper-component/text-editor/editor.tsx b/apps/designer/app/canvas/features/wrapper-component/text-editor/editor.tsx index 6f630ab5f9..3f1d2910cf 100644 --- a/apps/designer/app/canvas/features/wrapper-component/text-editor/editor.tsx +++ b/apps/designer/app/canvas/features/wrapper-component/text-editor/editor.tsx @@ -12,7 +12,7 @@ import { config } from "./config"; import { useEffect } from "react"; import { useSelectedElement } from "~/canvas/shared/nano-states"; -type EditorProps = { +export type EditorProps = { editable: JSX.Element; instance: Instance; onChange: (updates: ChildrenUpdates) => void; @@ -41,7 +41,7 @@ const Editor = ({ instance, editable, onChange }: EditorProps) => { ); }; -const EditorConfigured = (props) => { +const EditorConfigured = (props: EditorProps) => { return ( diff --git a/apps/designer/app/canvas/features/wrapper-component/text-editor/lazy-editor.tsx b/apps/designer/app/canvas/features/wrapper-component/text-editor/lazy-editor.tsx index 6d4ef29815..9ddfbab3a5 100644 --- a/apps/designer/app/canvas/features/wrapper-component/text-editor/lazy-editor.tsx +++ b/apps/designer/app/canvas/features/wrapper-component/text-editor/lazy-editor.tsx @@ -1,10 +1,11 @@ -import { memo, lazy, Suspense } from "react"; +import { memo, lazy, Suspense, ComponentProps } from "react"; +import type { EditorProps } from "./editor"; const EditorLazy = lazy(() => import("./editor")); -const EditorWithSuspense = (props) => { +const EditorWithSuspense = (props: EditorProps) => { return ( - Loading...}> + ); diff --git a/packages/tsconfig/remix.json b/packages/tsconfig/remix.json index aa57d759c2..80cd315097 100644 --- a/packages/tsconfig/remix.json +++ b/packages/tsconfig/remix.json @@ -5,8 +5,9 @@ "compilerOptions": { "noEmit": true, "jsx": "react-jsx", - "target": "ES2019", - "lib": ["DOM", "DOM.Iterable", "ES2019"] + "target": "ES2020", + "module": "ES2020", + "lib": ["DOM", "DOM.Iterable", "ES2020"] }, "include": ["app", "remix.env.d.ts"], "exclude": ["node_modules"]