๐ฅ๐ฒ๐ฎ๐ฐ๐ ๐๐ฆ ๐๐น๐ฒ๐ฎ๐ป ๐๐ผ๐ฑ๐ฒ ๐๐ฎ๐๐ถ๐ฐ๐
Write clean React code. It makes your work easier. Share Prettier settings with your team.
Follow these tips:
- Use template literals for strings.
- Use ternary operators instead of long if statements.
- Group your imports. Put React first. Put third party libraries second. Put local files last.
- Use OR for default values.
- Use AND to check if a value exists before using it.
- Move event handlers out of your return statement.
- Move styles into a separate object.
- Use an object map instead of a switch statement.
- Use UI libraries. Avoid raw HTML.
Source: https://dev.to/kkr0423/reactjs-clean-code-basic-3e16