When trying to run the following code I got an unexpected error:
import * as forgo from "forgo";
const App= () =>
new forgo.Component({
render() {
return <p>Tooltip</p>;
}
});
forgo.mount(document.getElementById("root"), <App />);
forgo.min.js:520 Uncaught Error: The container argument to the mount() function should be an HTML element.
Now, because of the typing of mount(), this doesn't throw an error, though I'm not sure why.
export function mount(
forgoNode: ForgoNode,
container: Element | string | null
): RenderResult {
return forgoInstance.mount(forgoNode, container);
}
null however is never a valid container because if (parentElement) will always return false.
When trying to run the following code I got an unexpected error:
forgo.min.js:520 Uncaught Error: The container argument to the mount() function should be an HTML element.Now, because of the typing of
mount(), this doesn't throw an error, though I'm not sure why.nullhowever is never a valid container becauseif (parentElement)will always returnfalse.