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
If am creating a tree that includes a webcomponent which updates on attributeChangedCallback. However, through hyperx, all specified attributes end up being passed to virtual-dom as props, because attributes need to be all passed together within an attributes sub-object.
Currently with a view like below:
...all the three attributes end up being assigned directly to the DOM element rather than via setAttribute.
I realize this is perhaps because virtual-dom does not adhere to the hyperscript API (as specified, h(tagName, attrs, children), when virtual-dom actually takes h(tagName, props ={attributes: {} }, children)). But if hyperx shouldn't be expected to account for these differences, then the documentation should probably be updated to let people know it won't work as expected with virtual-dom specifically and save some time :) Thanks!
The text was updated successfully, but these errors were encountered:
brokenalarms
changed the title
How to distinguish between attributes and props?
How to distinguish between attributes and props? API doesn't match for virtual-dom
Oct 20, 2016
brokenalarms
changed the title
How to distinguish between attributes and props? API doesn't match for virtual-dom
API doesn't match for virtual-dom - no way to set attributes?
Oct 20, 2016
Tried hyper-script, but as per their documentation:
Note that hyperscript sets properties on the DOM element object, not attributes on the HTML element.
So basically this approach does not work with web components reliant on attributeChangedCallbacks?
Specifically, I was using morphdom for this (which just assigns everything as attributes (to my mind, correctly for the purposes of how the element is represented in the view function), but thought I'd try hyperxbecause it enabled for more generic switching layer and use of hyperxify.
Hi
If am creating a tree that includes a webcomponent which updates on
attributeChangedCallback
. However, throughhyperx
, all specified attributes end up being passed tovirtual-dom
as props, because attributes need to be all passed together within anattributes
sub-object.Currently with a view like below:
...all the three attributes end up being assigned directly to the DOM element rather than via
setAttribute
.I realize this is perhaps because
virtual-dom
does not adhere to the hyperscript API (as specified,h(tagName, attrs, children)
, whenvirtual-dom
actually takesh(tagName, props ={attributes: {} }, children)
). But ifhyperx
shouldn't be expected to account for these differences, then the documentation should probably be updated to let people know it won't work as expected withvirtual-dom
specifically and save some time :) Thanks!The text was updated successfully, but these errors were encountered: