mirror of
https://github.com/webstudio-is/webstudio.git
synced 2026-11-08 21:15:18 +09:00
fix types, enable async imports in ts
This commit is contained in:
1 parent
085f7836ff
commit
d99adaf329
3 files changed
+9
-7
No files matched your search
@@ -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 (
|
||||
<LexicalComposer initialConfig={config}>
|
||||
<Editor {...props} />
|
||||
|
||||
@@ -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 (
|
||||
<Suspense fallback={<div>Loading...</div>}>
|
||||
<Suspense fallback={props.editable}>
|
||||
<EditorLazy {...props} />
|
||||
</Suspense>
|
||||
);
|
||||
|
||||
@@ -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"]
|
||||
|
||||
Reference in new issue
Block a user