Created
January 13, 2018 04:17
-
-
Save Metnew/c576204f7cc0db7de3a53e8bea5f7ed1 to your computer and use it in GitHub Desktop.
Component vs PureComponent vs “stateless component”
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
if (componentHasNoState) { | |
return itsStatelessComponent() | |
} else if (componentHasSimplePropsState && propsHasNoNestedObjects) { | |
return itsPureComponent() | |
} else { | |
return itsComponent() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment