View on GitHub

reading-notes

My learning journal for Code Fellows

React 3

Next.js

Next.js is a helpful framework to standardize a lo of the smaller and more housekeeping-like elements of building a website.

React Context

React context allows you to pass down and use data in whatever component you would like without the use of props. This helps with the idea of props drilling, or when you need to pass props down multiple levels into a component.

The four steps to using React context:

  1. Create context with the createContext method.

  2. Take your creates context and wrap the context provider around your component tree.

  3. Put any value you like on the context provider using the value prop.

  4. Read that value with and component by using the context consumer.