You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We could make VNode generic on its actual dom type. So div could be of type dom.html.Div and so forth. That would mean we have HtmlVNode[E <: dom.html.Element] and SvgNode[E <: dom.svg.Element]. Then we could have an apply method which takes a VDomModifier[dom.html.Element] respectively VDomModifier[dom.svg.Element], thereby we could only apply html attrs to html tags and the same for svg.
Furthermore, we could try to make our EmitterBuilder[dom.Event, R] work with this information. it would be great to have a typesafe way to access the current element from a dom event or hook. Then you could have input( onDomMount.foreach { elem: dom.html.Input => ??? }, onInput.map(_.currentTarget.value) --> sink).
We have helpers like onInput.value as of now but they are not typesafe but just cast to an input element and assumes the value property exists (see #93). We want the compiler to tell us about these problems.
We could make
VNode
generic on its actual dom type. Sodiv
could be of typedom.html.Div
and so forth. That would mean we haveHtmlVNode[E <: dom.html.Element]
andSvgNode[E <: dom.svg.Element]
. Then we could have an apply method which takes aVDomModifier[dom.html.Element]
respectivelyVDomModifier[dom.svg.Element]
, thereby we could only apply html attrs to html tags and the same for svg.Furthermore, we could try to make our
EmitterBuilder[dom.Event, R]
work with this information. it would be great to have a typesafe way to access the current element from a dom event or hook. Then you could haveinput( onDomMount.foreach { elem: dom.html.Input => ??? }, onInput.map(_.currentTarget.value) --> sink)
.We have helpers like
onInput.value
as of now but they are not typesafe but just cast to an input element and assumes the value property exists (see #93). We want the compiler to tell us about these problems.PR #237 makes a first step.
The text was updated successfully, but these errors were encountered: