Code 401: Class 34 - Login and Auth
Questions
-
Why is the context API useful? Useful when some data needs to be accessible by many components at different levels.
-
Can a component outside of a provider get its context? Yes, it is possible to access context outside of a provider.
-
What are some common use cases focusing the Context API? Where data or state is needed by all or most components such as page themes
-
Describe “Context Hell” Many nested layers of components passing context down
Vocabulary
- Global State A higher order component that stores state that is needed by many other components
- Global Context Top level object that will contain all of the context for all consumers
- Provider Context object that shares props with all consumers, consumers will rerender when every provider prop changes
- Consumer Subscribes to a provider and rerenders whenever the provider props change
- RBAC (Role Based Access Control)
- Limits network access to only those who need access and provides access to only what is needed by job role
- Benefits
- Reduces administrative work and IT support
- Maximizing operational efficiency
- Improves compliance regarding the safeguarding of sensitive data
- Documentation for NPM package react-cookies
npm i react-cookies --save
- Documentation for NPM package React-Cookie
npm i react-cookie
Return to reading-notes Deployed Site
Return to reading-notes Mark Down