Created
February 28, 2019 08:04
-
-
Save 3nvi/8564ecc3a02d78657580021e40f7ea6e to your computer and use it in GitHub Desktop.
This file contains 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
// Don't do this! | |
function Component(props) { | |
const aProp = { someProp: 'someValue' } | |
return <AnotherComponent style={{ margin: 0 }} aProp={aProp} /> | |
} | |
// Do this instead :) | |
const styles = { margin: 0 }; | |
function Component(props) { | |
const aProp = { someProp: 'someValue' } | |
return <AnotherComponent style={styles} {...aProp} /> | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment