Skip to content
Snippets Groups Projects
Commit 0f3c6156 authored by chris's avatar chris
Browse files

remove mounted

parent 34a1ff41
No related branches found
No related tags found
1 merge request!391Matching question
...@@ -6,7 +6,6 @@ import React, { ...@@ -6,7 +6,6 @@ import React, {
useCallback, useCallback,
useMemo, useMemo,
useEffect, useEffect,
useState,
forwardRef, forwardRef,
useImperativeHandle, useImperativeHandle,
} from 'react'; } from 'react';
...@@ -46,7 +45,6 @@ const WaxView = forwardRef((props, ref) => { ...@@ -46,7 +45,6 @@ const WaxView = forwardRef((props, ref) => {
} = props; } = props;
const WaxEditorRef = useRef(); const WaxEditorRef = useRef();
const [mounted, setMounted] = useState(false);
const context = useContext(WaxContext); const context = useContext(WaxContext);
const { createPortal } = useContext(PortalContext); const { createPortal } = useContext(PortalContext);
...@@ -54,11 +52,6 @@ const WaxView = forwardRef((props, ref) => { ...@@ -54,11 +52,6 @@ const WaxView = forwardRef((props, ref) => {
const schema = context.app.getSchema(); const schema = context.app.getSchema();
if (!mounted) {
context.app.bootServices();
context.app.getShortCuts();
}
const setEditorRef = useCallback( const setEditorRef = useCallback(
// eslint-disable-next-line consistent-return // eslint-disable-next-line consistent-return
node => { node => {
...@@ -68,6 +61,9 @@ const WaxView = forwardRef((props, ref) => { ...@@ -68,6 +61,9 @@ const WaxView = forwardRef((props, ref) => {
// clean up the unmount if you need to. // clean up the unmount if you need to.
} }
if (node) { if (node) {
context.app.bootServices();
context.app.getShortCuts();
const options = WaxOptions({ const options = WaxOptions({
...props, ...props,
schema, schema,
...@@ -99,8 +95,6 @@ const WaxView = forwardRef((props, ref) => { ...@@ -99,8 +95,6 @@ const WaxView = forwardRef((props, ref) => {
}, },
); );
setMounted(true);
context.updateView( context.updateView(
{ {
main: view, main: view,
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment