Created
October 23, 2018 18:47
-
-
Save luciotbc/1eddbf8ebb1aa1e353e5362309dd69ba to your computer and use it in GitHub Desktop.
BestPracticesForReact03_RenderExamples.jsx
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
// Bad | |
render() { | |
return <Welcome className="class"> | |
<child /> | |
</Welcome>; | |
} | |
// Good | |
render() { | |
return ( | |
<Welcome className="class"> | |
<child /> | |
</Welcome> | |
); | |
} | |
// This is good too | |
render() { | |
const child = <child />; | |
return <Welcome className="class">{child}</Welcome>; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment