Created
May 30, 2018 18:34
-
-
Save Archakov06/45fe1264dca019d48a0c32c49a56d356 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
// плохо | |
function SFC({ foo, bar, children }) { | |
return <div>{foo}{bar}{children}</div>; | |
} | |
SFC.propTypes = { | |
foo: PropTypes.number.isRequired, | |
bar: PropTypes.string, | |
children: PropTypes.node, | |
}; | |
// хорошо | |
function SFC({ foo, bar, children }) { | |
return <div>{foo}{bar}{children}</div>; | |
} | |
SFC.propTypes = { | |
foo: PropTypes.number.isRequired, | |
bar: PropTypes.string, | |
children: PropTypes.node, | |
}; | |
SFC.defaultProps = { | |
bar: '', | |
children: null, | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment