I'm wary of any new syntax for a specific pattern like that. If we did come up with something, would it apply to the the normal "event" or "action" prop callbacks?
<button onClick={() => /* not really different */}/>
I've found it feels less syntax-crazy when you use a prop named render instead goofing around with children.
<Thing render={() => (
<div>More Stuff</div>
)}/>
// vs.
<Thing>
{() => (
<div>More Stuff</div>
)}
</Thing>
That said, if you use children and skip JSX completely it's totally natural, it's just a normal looking callback:
fs.readFile(path, (err, data) => {
// callback!
})
let e = React.createElement
e(Fetch, ({ error, data }) => (
// callback!
))
I sometimes think I'd rather use e than JSX. Imagine this code block w/o JSX, would actually look pretty clean: github.com/ReactTraining/react-router/blob/master…