Add context to form editor entrypoint

[MAILPOET-2389]
This commit is contained in:
Amine Ben hammou
2019-11-27 14:11:09 +01:00
committed by Jack Kitterhing
parent 62bd6f1126
commit b98df95ccc

View File

@@ -1,14 +1,21 @@
import React from 'react';
import ReactDOM from 'react-dom';
import { GlobalContext, useGlobalContextValue } from 'context/index.jsx';
import Editor from './components/editor.jsx';
import initStore from './store/store.jsx';
const App = () => (
<GlobalContext.Provider value={useGlobalContextValue(window)}>
<Editor />
</GlobalContext.Provider>
);
const appElement = document.querySelector('#mailpoet_form_edit');
if (appElement) {
initStore();
ReactDOM.render(
<Editor />,
<App />,
appElement
);
}