Dynamic prop/attr names
Open
discussion
proposal
- Dominant language
- JavaScript
- Stars
- 9k
- Forks
- 181
- PR merge metrics
- No merged PRs in 30d
Description
Not the same as #109.
That would be useful to have insertable attribute names:
```js
html``
// same as
html``
```
## Practical cases
Optional attributes:
```js
html``
```
Private props:
```js
let html = htm.bind(h)
let _data = Symbol('data')
html``
function h (tag, props) {
props[_data]
}
```
Anonymous props:
```js
html``
function draggable(el) {
...
}
draggable[Symbol.toPrimitive] = () => 'data-draggable'
```
@developit @jviide would you consider that feature?
Contributor guide
Assessment
This issue has not been assessed yet.