mirror of
https://github.com/smartxworks/sunmao-ui.git
synced 2025-04-12 21:50:23 +08:00
export Editor as component
This commit is contained in:
parent
f477faf2a9
commit
3620452f1e
@ -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<Registry['registerComponent']>[0][];
|
||||
@ -16,6 +16,15 @@ type Options = Partial<{
|
||||
container: Element;
|
||||
}>;
|
||||
|
||||
export const App: React.FC = () => {
|
||||
return (
|
||||
<ChakraProvider>
|
||||
<Editor App={_App} registry={registry} stateStore={stateStore} />
|
||||
</ChakraProvider>
|
||||
);
|
||||
};
|
||||
export { registry, editorStore, stateStore };
|
||||
|
||||
export default function renderApp(options: Options = {}) {
|
||||
const {
|
||||
components = [],
|
||||
@ -30,9 +39,7 @@ export default function renderApp(options: Options = {}) {
|
||||
|
||||
ReactDOM.render(
|
||||
<StrictMode>
|
||||
<ChakraProvider>
|
||||
<Editor App={App} registry={registry} stateStore={stateStore} />
|
||||
</ChakraProvider>
|
||||
<App />
|
||||
</StrictMode>,
|
||||
container
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user