Slide 9
Slide 9 text
React
specific
standards
Separate imports
Segregate imports based on type - React imports, our code import & 3rd party
imports
Name any function returning UI elements as `renderXYZ`
Starting the name of these functions with render will help debug better & improve
readability
Avoid mixing up JS & JSX
Segregate UI rendering logic(JSX) & the business logic(JS) as separate
functions/files.
Reduce props being passed
Instead of passing a huge number of props, pass in an object
Prefer mapping over components over ternary operator
Having multiple ternary operators to render UI conditionally can become hard,
instead put all components in a array & use them based on keys.