forgo.mount() typing not matching with behaviour
- Dominant language
- TypeScript
- Stars
- 321
- Forks
- 10
- PR merge metrics
- No merged PRs in 30d
Description
When trying to run the following code I got an unexpected error:
```tsx
import * as forgo from "forgo";
const App= () =>
new forgo.Component({
render() {
return
Tooltip
;}
});
forgo.mount(document.getElementById("root"), );
```
`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.
```ts
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`.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.