Add context to form editor entrypoint
[MAILPOET-2389]
This commit is contained in:
committed by
Jack Kitterhing
parent
62bd6f1126
commit
b98df95ccc
@@ -1,14 +1,21 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import ReactDOM from 'react-dom';
|
import ReactDOM from 'react-dom';
|
||||||
|
import { GlobalContext, useGlobalContextValue } from 'context/index.jsx';
|
||||||
import Editor from './components/editor.jsx';
|
import Editor from './components/editor.jsx';
|
||||||
import initStore from './store/store.jsx';
|
import initStore from './store/store.jsx';
|
||||||
|
|
||||||
|
const App = () => (
|
||||||
|
<GlobalContext.Provider value={useGlobalContextValue(window)}>
|
||||||
|
<Editor />
|
||||||
|
</GlobalContext.Provider>
|
||||||
|
);
|
||||||
|
|
||||||
const appElement = document.querySelector('#mailpoet_form_edit');
|
const appElement = document.querySelector('#mailpoet_form_edit');
|
||||||
|
|
||||||
if (appElement) {
|
if (appElement) {
|
||||||
initStore();
|
initStore();
|
||||||
ReactDOM.render(
|
ReactDOM.render(
|
||||||
<Editor />,
|
<App />,
|
||||||
appElement
|
appElement
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user