I'm trying to add a Dropzone to a page dynamically but I either get an "Uncaught Error: Invalid dropzone element. at new $3ed2...." or "Uncaught ReferenceError: Dropzone is not defined" while trying to use the examples from Dropzone.js.
Basically I have a function like:
export function UploadComponent(props) {
....
return html`<div>
<form action="/target" class="dropzone" id="my-dropzone">Upload files here</form>
</div>
}
The function gets called after the page is loaded by a button click so that dropzone is added to the screen. My issue is getting the Dropzone.js scripts added after the HTML is rendered. Any advice on this is much appreciated! Wondering if the only way to do this is to have something polling to check for the html component to be loaded.
Different variations of the Dropzone.js documentation