mlmorg / react-hyperscript

Hyperscript syntax for React.js markup
MIT License
710 stars 45 forks source link

Support for parsing attributes? #5

Closed af closed 9 years ago

af commented 9 years ago

It'd be handy in some cases to put attributes besides class/id in the tag string, for more concise DOM definitions. For example:

h('form', [
  h('input[name=account][type=number]'),
  h('input[name=passwd][type=password]')
])

I realize this module defers to virtual-hyperscript for string parsing, and I can't see that upstream module adding this, based on this discussion. Maybe the attrs could be parsed out before sending the rest of the string to the hyperscript parser. Is this something you'd be interested in supporting?

af commented 9 years ago

Closing, I'm working on https://github.com/af/JSnoX to scratch my own itch :^)