React TL;DR – a human filter for most useful React content.

All posts

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