hyperscript icon indicating copy to clipboard operation
hyperscript copied to clipboard

Documentation and Example have different argument order

Open joeframbach opened this issue 5 years ago • 0 comments

The example in the README shows (selector, content, attributes).

h('h1.classy', 'h', { style: {'background-color': '#22f'} }))

But the API documentation shows (selector, attributes, content).

h (tag, attrs, [text?, Elements?,...])

h('h1.fun', {style: {'font-family': 'Comic Sans MS'}}, 'Happy Birthday!')

It was very confusing for me to read the example and figure out what it means, it was not obvious that h was the text content and not some h tagName.

The interactive demo shows that any argument order works, but I think you should standardize on (selector, attributes, content).

joeframbach avatar May 28 '20 00:05 joeframbach