Closed leolorenzoluis closed 2 years ago
Lit templates are just HTML and apparently self-closing tags are not allowed in custom web components in HTML either: https://github.com/lit/lit/issues/630
I assume that self-closing tags are allowed in React because JSX is not the same as HTML and they just get desugared to a component call without children.
Got it. Was confused with the documentation
// MyComponent.fs
let register() = ()
[<LitElement("my-component")>]
let MyComponent() = ...
// App.fs
MyComponent.register()
html $"<my-component />"
Let me submit a PR to fix that
Given the following code:
The
{model.Monitors |> Lit.mapUnique (fun t -> t.Id.ToString()) renderItem}
is getting rendered inside the<ping-bar>
instead of closing the tag on itself.Solution: Changing
<ping-bar/>
to<ping-bar></ping-bar>
fixes it.