React Context and Hooks
React Context
Yesterday I reviewed the React Context section. It explains:
- The Problem: Prop drilling more than 2 layers
- The Parts:
- Provider
- Consumer
- The Context tunnel
- Techniques:
contextType
: This is limited to class components and cannot be used to pass on functions.- 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:
useState
useEffect
And I'm building a cool Speed Typing app along the way.