Initialize form editor after dom is loaded
We need window.wpApiSettings which is initialized by WordPress in page footer. [MAILPOET-2750]
This commit is contained in:
committed by
Veljko V
parent
f01643b50f
commit
c34eddd3be
@@ -15,15 +15,16 @@ const App = () => (
|
|||||||
</GlobalContext.Provider>
|
</GlobalContext.Provider>
|
||||||
);
|
);
|
||||||
|
|
||||||
const appElement = document.querySelector('#mailpoet_form_edit');
|
window.addEventListener('DOMContentLoaded', () => {
|
||||||
|
const appElement = document.querySelector('#mailpoet_form_edit');
|
||||||
if (appElement) {
|
if (appElement) {
|
||||||
initStore();
|
initStore();
|
||||||
initBlocks();
|
initBlocks();
|
||||||
ReactDOM.render(
|
ReactDOM.render(
|
||||||
<React.StrictMode>
|
<React.StrictMode>
|
||||||
<App />
|
<App />
|
||||||
</React.StrictMode>,
|
</React.StrictMode>,
|
||||||
appElement
|
appElement
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
Reference in New Issue
Block a user