Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation and Example have different argument order #92

Open
joeframbach opened this issue May 28, 2020 · 0 comments
Open

Documentation and Example have different argument order #92

joeframbach opened this issue May 28, 2020 · 0 comments

Comments

@joeframbach
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant