Not able to load web-component based Javascript file
nikhilatkan opened this issue · comments
I want to embed a javascript file but not able to load it on the project.
Tried this,
const view = (state, {updateState}) => {
function AddLibrary(urlOfTheLibrary) {
console.log("add librar",urlOfTheLibrary);
const script = document.createElement('script');
script.src = urlOfTheLibrary;
document.head.appendChild(script);
}
return (
<div>
<div>Hello</div>
<sg-bar hook-init={AddLibrary("/sg-bar.js")}></sg-bar>
</div>
);
};
Also it is not able to find that specific javascript file in the dist folder after building.
To a lurker, this issue is difficult to understand. Multiple un-related problems are mentioned; web-component-based file problems, embedding and loading problems, web-serving problems and application building problems. The code block is incorrectly placed in the markdown, and snabbdom is not demonstrated anywhere.
Politely, I recommend closing this issue or editing it to clearly describe a problem related to snabbdom