reading-notes

reading notes for code fellows


Project maintained by dLeigh01 Hosted on GitHub Pages — Theme by mattgraham

React 3

This is important information in completing our Next.js applications in a well coded way.

React Context

React Context allows you to easily share state within your applications. It should be used when you are passing data that can be used in any component in your application such as theme data, user data, or location-specific data. It helps us to avoid needing to drill down multiple levels with props. Context is an API built directly into React that you can access by using the createContext method and wrapping the created context around your component tree. You can put any value into it using the value prop and then read that value in any other component using the context consumer.

Discussion

Context is a very helpful way to avoid prop drilling, and I think it could be very useful for some aspects or coming or previous applications.

[< table of contents]

[< home]