mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-29 21:51:59 +02:00
Better code splitting and removed final instances of react-dnd
This commit is contained in:
13
src-web/components/core/Editor/LazyEditor.tsx
Normal file
13
src-web/components/core/Editor/LazyEditor.tsx
Normal file
@@ -0,0 +1,13 @@
|
||||
import type { EditorView } from '@codemirror/view';
|
||||
import { forwardRef, lazy, Suspense } from 'react';
|
||||
import type { EditorProps } from './Editor';
|
||||
|
||||
const Editor_ = lazy(() => import('./Editor').then((m) => ({ default: m.Editor })));
|
||||
|
||||
export const Editor = forwardRef<EditorView, EditorProps>(function LazyEditor(props, ref) {
|
||||
return (
|
||||
<Suspense>
|
||||
<Editor_ ref={ref} {...props} />
|
||||
</Suspense>
|
||||
);
|
||||
});
|
||||
Reference in New Issue
Block a user