Fix toVNode() for comment nodes, lacking some fields
Comment nodes when converted to VNode were lacking vnode.data and vnode.elm, which in turn would break use cases with modules such as the style module (Which assumed vnode.data to be defined). Since toVNode is used as an initial step (e.g. for server-side rendered content), there is no reason to not provide vnode.elm since that vnode may be used as the "prevVNode" during patch. Also, because comment vnodes have the '!' sel, most logic in snabbdom that detects a truthy sel will also assume a truthy data field. It is easier to build the comment vnode with those fields than to modify all the logic elsewhere in snabbdom.pull/296/head
parent
72431c820e
commit
4b4a34ad0f
Loading…
Reference in New Issue