choojs / choojs/hyperx

API doesn't match for virtual-dom - no way to set attributes?

Open
#37 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
1k
Forks
45
PR merge metrics
No merged PRs in 30d

Description

Hi

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:

``` javascript
return html `
`
```

...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!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.