Last active
January 13, 2017 18:35
-
-
Save chris-kobrzak/e1721578ce8f6402726f5277f8b63e32 to your computer and use it in GitHub Desktop.
Demonstrate poor practice of JSX intertwined with logic, coupled with multi-line ternary operator statements
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
render () { | |
const { visible } = this.props | |
return ( | |
<div className={ visible ? 'expanded' : 'collapsed' }> | |
{ | |
visible ? <div> | |
// Dozens of lines of JSX code here | |
// Dozens of lines of JSX code here | |
// Dozens of lines of JSX code here | |
// Dozens of lines of JSX code here | |
// Dozens of lines of JSX code here | |
// Dozens of lines of JSX code here | |
// Dozens of lines of JSX code here | |
// Dozens of lines of JSX code here | |
// Dozens of lines of JSX code here | |
// Dozens of lines of JSX code here | |
// Dozens of lines of JSX code here | |
// Dozens of lines of JSX code here | |
// Dozens of lines of JSX code here | |
// Dozens of lines of JSX code here | |
// Dozens of lines of JSX code here | |
</div> : null // <- null is a code smell! | |
} | |
</div> | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment