A comprehensive introduction to React hooks
Before going into hooks, let's first have a quick recap of the basics of React:
- React components are functions that take in props and return HTML-like fragments
- Props are the arguments to a component, which look like HTML attributes.
- The component function is called every time the component re-renders
- Components choose to re-render when their parent component re-renders, or when their state updates (when a useState's "set" function is invoked).