We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
For apps that load the react-abode script in the head instead of bottom of body, would it be possible to amend to check for DOMContentLoaded event?
head
body
DOMContentLoaded
Something like the below perhaps:
export const populate = async (options?: PopulateOptions) => { if (/complete|interactive|loaded/.test(document.readyState)) { addNewComponentHandler(options); } else { document.addEventListener('DOMContentLoaded', ()=> addNewComponentHandler(options), false); } }; const addNewComponentHandler = async (options?: PopulateOptions) => { await checkForAndHandleNewComponents(options); document.body.addEventListener('DOMNodeInserted', () => checkForAndHandleNewComponents(options)) };
If I attempt to configure the script in head now, I receive the error:
Uncaught (in promise) TypeError: Cannot read properties of null (reading 'addEventListener')
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Running script from head tag vs body
For apps that load the react-abode script in the
head
instead of bottom ofbody
, would it be possible to amend to check forDOMContentLoaded
event?Something like the below perhaps:
If I attempt to configure the script in
head
now, I receive the error:The text was updated successfully, but these errors were encountered: