Wouldn't it be more convenient to have direct syntax for this in JSX?
-
-
I believe that is some people’s objection. Children as a function is not a valid type for children according to docs.
1 reply 0 retweets 0 likes -
Replying to @joeytrapp @wycats and
It's fine. People are just prematurely optimizing and its starting to spread. That's all.
1 reply 0 retweets 3 likes -
Replying to @ryanflorence @joeytrapp and
Also, the docs explicitly state functions as children is a valid, seehttps://facebook.github.io/react/docs/jsx-in-depth.html#functions-as-children …
2 replies 0 retweets 1 like -
Replying to @aweary @ryanflorence and
Glad to see it officially supported. My only objection was what if it disappeared. Didn’t want to rely on an unsupported API/feature
1 reply 0 retweets 0 likes -
Replying to @joeytrapp @aweary and
children has always been "just a prop". What you put there doesn't matter. It's special because of its position in JSX (and createElement)
2 replies 0 retweets 1 like -
Replying to @ryanflorence @joeytrapp and
I mean this usage is visually pretty noisy just to add a parameter to a callback. But whatever floats ppl's boats.
1 reply 0 retweets 1 like -
Replying to @wycats @joeytrapp and
Agree, that's why I use `render` not children.
1 reply 0 retweets 0 likes -
Replying to @ryanflorence @joeytrapp and
It also seems like it's leaning on the special behavior of "one child means children is not an array" - I didn't know about that
1 reply 0 retweets 0 likes -
Replying to @wycats @ryanflorence and
To be fair, that's why React.Children.only exists
1 reply 0 retweets 1 like
Yeah, fair enough.
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.