React Context and Hooks

React Context

Yesterday I reviewed the React Context section. It explains:

  1. The Problem: Prop drilling more than 2 layers
  2. The Parts:
    1. Provider
    2. Consumer
    3. The Context tunnel
  3. Techniques:
    1. contextType: This is limited to class components and cannot be used to pass on functions.
    2. Separate components with render props: This can be used for functional components and to pass functions.

React Hooks

I also went through the first part of the Hooks section. In it I reviewed:

  1. useState
  2. useEffect

And I'm building a cool Speed Typing app along the way.