15 React Best Practices You Need to Follow in 2020

- ๐ Keep components small and function-specific
- โป๏ธ Reusability is important, so keep creation of new components to the minimum required
- ๐ค Consolidate duplicate code โ DRY your code
- ๐จ Put CSS in JavaScript
- ๐ Comment only where necessary
- ๐ Name the component after the function
- ๐ฆ Use capitals for component names
- ๐ซ Mind the other naming conventions
- ๐ญ Separate stateful aspects from rendering
- ๐ Code should execute as expected and be testable
- ๐ All files related to any one component should be in a single folder
- ๐งฐ Use tools like Bit
- ๐ Use snippet libraries
- โ๏ธ Write tests for all code
- ๐ Follow linting rules, break up lines that are too long