question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow h to receive children as the second argument.

See original GitHub issue

If this involves a lot of code, then the benefit will not balance the bundle size increase tradeoff, otherwise it would be nice to have.

Instead of:

h("h1", {}, "Hello")

Allow h to work like this too:

h("h1", "Hello")

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:2
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
jorgebucarancommented, Feb 26, 2017

@lukejacksonn Remember than JSX/Hyperx is transformed into h calls in your dist/bundle.

Some people think a good reason to use vanilla h is to “avoid” a build pipeline, but you are still going to bundle assets and uglify the code anyway, so using pure h calls does not remove the need of a build setup, it just mitigates some of the overhead of using so much tooling.

But, like I said above, if this fix does not entail a lot of code, then why not just make the data optional. I’ve added this to the 0.6.0 milestone.

0reactions
jorgebucarancommented, Mar 3, 2017

Closing as won’t fix! 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

React Children And Iteration Methods - Smashing Magazine
In this article, we'll discuss and learn about the use case of iterating over React `children` and the ways to do it. In...
Read more >
How to pass props to {this.props.children} - Stack Overflow
Cloning children with new props. You can use React.Children to iterate over the children, and then clone each element with new props (shallow...
Read more >
Children as second argument out of line with API · Issue #2 ... - GitHub
Isn't this out of step with the React API where children is on the props ... jsx-pragmatic will accept undefined returned from a...
Read more >
How to pass data to a React component's props.children
In the above example, the <Link> component will receive a children function that expects to be called with a single argument: isActive ....
Read more >
Children - React Docs
It will be called with the child as the first argument and its index as the second argument. The index starts at 0...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found