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>
|
||||
);
|
||||
|
||||
const appElement = document.querySelector('#mailpoet_form_edit');
|
||||
|
||||
if (appElement) {
|
||||
initStore();
|
||||
initBlocks();
|
||||
ReactDOM.render(
|
||||
<React.StrictMode>
|
||||
<App />
|
||||
</React.StrictMode>,
|
||||
appElement
|
||||
);
|
||||
}
|
||||
window.addEventListener('DOMContentLoaded', () => {
|
||||
const appElement = document.querySelector('#mailpoet_form_edit');
|
||||
if (appElement) {
|
||||
initStore();
|
||||
initBlocks();
|
||||
ReactDOM.render(
|
||||
<React.StrictMode>
|
||||
<App />
|
||||
</React.StrictMode>,
|
||||
appElement
|
||||
);
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user