Start here

General React notes/tips for beginners:

  • Always choose functional components over class components. Especially now that React hooks exist and offer everything that class components do (ie using state, lifecycle methods).
  • Higher order components (HOCs) will be a big help with creating reusable components and offer a great way to share logic without repeating in different parts of your app.
  • Start using PropTypes from the beginning
  • All JSX/component attributes/props should be on a new line.
  • JSX/React components are self closing, utilize this feature when possible.
  • Props should be destructured for easier readability and cleaner code (https://medium.freecodecamp.org/the-basics-of-destructuring-props-in-react-a196696f5477)
  • Make components as small as possible.
  • Vscode react extensions (keyboard shortcuts help to scaffold components faster, https://marketplace.visualstudio.com/items?itemName=xabikos.ReactSnippets) and speed up development.