You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, whatever is passed in value gets overwritten by children (code below). We could change the below for not overwritten args[0] if children is falsy. so we enable both usages in your description.
@gnarf I see you have a preference, but the motivation isn't clear to me. Using a value attribute instead of children might be convenient in the given example (I agree), but using the opposite (children instead of a value attribute) might be convenient in other cases like:
<FormatMessage>You’re receiving notifications because you commented</FormatMessage>
I hold my preference for "use this.props.value if set, otherwise use this.props.children". I don't see any problem with allowing both options this way.
I agree with @rxaviers here. I am working on adding some initial tests to the repo (PR almost ready) and then I will add this "use this.props.value if set, otherwise use this.props.children" functionality along with additional tests
Activity
rxaviers commentedon Dec 16, 2015
Hi,
Currently, whatever is passed in
valuegets overwritten bychildren(code below). We could change the below for not overwrittenargs[0]ifchildrenis falsy. so we enable both usages in your description.Would you like to submit a pull request with such change?
fdecampredon commentedon Dec 16, 2015
I'll do so !
kborchers commentedon Mar 11, 2016
Hi @fdecampredon. Are you still interested in working on this?
cowboy commentedon Mar 11, 2016
I had the same question. I'd love to see this implemented. Basically, use
this.props.valueif set, otherwise usethis.props.children.gnarf commentedon Mar 11, 2016
I actually think that you should only allow
value=prop and deprecate thechildrenformat.cowboy commentedon Mar 11, 2016
👍 to that
rxaviers commentedon Mar 15, 2016
@gnarf I see you have a preference, but the motivation isn't clear to me. Using a value attribute instead of children might be convenient in the given example (I agree), but using the opposite (children instead of a value attribute) might be convenient in other cases like:
I hold my preference for "use
this.props.valueif set, otherwise usethis.props.children". I don't see any problem with allowing both options this way.PRs are still very welcome. Thanks
kborchers commentedon Mar 15, 2016
I agree with @rxaviers here. I am working on adding some initial tests to the repo (PR almost ready) and then I will add this "use
this.props.valueif set, otherwise usethis.props.children" functionality along with additional testsAdd ability to use value prop and fall back to children