Skip to content

Instantly share code, notes, and snippets.

@zephraph
Last active January 29, 2020 16:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zephraph/a47544c2d2d423a7751d1467edf70cb9 to your computer and use it in GitHub Desktop.
Save zephraph/a47544c2d2d423a7751d1467edf70cb9 to your computer and use it in GitHub Desktop.
Example of component with implicit return
// Don't allow this
export const ArrowComponent = () => (
<div>
<h1>My special implicit arrow function</h1>
</div>
)
// This is okay
export const SimpleComponent = () => <h1>This is fine</h1>
// This is preferred for multi-line
export const ComplexComponent = () => {
return (
<div>
<h1>This is the right way</h1>
</div>
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment