Created
May 27, 2015 14:35
-
-
Save c7tincu/a25aff277b3773c6d97c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// You’d expect this one… | |
render() { | |
return ( | |
<button { ...this.props } className={ this.cn + (this.props.className ? ' ' + this.props.className : '') }> | |
{ this.props.children } | |
</button> | |
); | |
} | |
// …and this another one… | |
render() { | |
return ( | |
<button className={ this.cn + (this.props.className ? ' ' + this.props.className : '') } { ...this.props }> | |
{ this.props.children } | |
</button> | |
); | |
} | |
// …to be the same, right!? Well, guess again… |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The fragments which differ are
{ ...this.props } className={ … }
vs.className={ … } { ...this.props }
…