From 3620452f1e6d8a36de87d2077a14ff1f2fef6a4e Mon Sep 17 00:00:00 2001 From: Yanzhen Yu Date: Thu, 2 Dec 2021 23:28:44 +0800 Subject: [PATCH] export Editor as component --- packages/editor/src/main.tsx | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/packages/editor/src/main.tsx b/packages/editor/src/main.tsx index e12f57ca..d7bb673d 100644 --- a/packages/editor/src/main.tsx +++ b/packages/editor/src/main.tsx @@ -7,7 +7,7 @@ import 'react-resizable/css/styles.css'; import { Editor } from './components/Editor'; import { editorStore } from './EditorStore'; -import { App, registry, stateStore } from './setup'; +import { App as _App, registry, stateStore } from './setup'; type Options = Partial<{ components: Parameters[0][]; @@ -16,6 +16,15 @@ type Options = Partial<{ container: Element; }>; +export const App: React.FC = () => { + return ( + + + + ); +}; +export { registry, editorStore, stateStore }; + export default function renderApp(options: Options = {}) { const { components = [], @@ -30,9 +39,7 @@ export default function renderApp(options: Options = {}) { ReactDOM.render( - - - + , container );