Last active
January 29, 2020 16:47
-
-
Save zephraph/a47544c2d2d423a7751d1467edf70cb9 to your computer and use it in GitHub Desktop.
Example of component with implicit return
This file contains hidden or 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
// 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