Skip to content

Instantly share code, notes, and snippets.

@luciotbc
Created October 23, 2018 18:47
Show Gist options
  • Save luciotbc/1eddbf8ebb1aa1e353e5362309dd69ba to your computer and use it in GitHub Desktop.
Save luciotbc/1eddbf8ebb1aa1e353e5362309dd69ba to your computer and use it in GitHub Desktop.
BestPracticesForReact03_RenderExamples.jsx
// 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