Context Flashcards
1
Q
What is the purpose of React “context”?
A
to pass states between applications
2
Q
What values can be stored in context?
A
any value that is set by the function or state
3
Q
How do you create context and make it available to the components?
A
export default the context and make it imported on all areas to share the state
4
Q
How do you access the context values?
A
through props with the help of useContext method in React
5
Q
When would you use context? (in addition to the best answer: “rarely”)
A
when you need to share information with other portions of the app when they are not located in the same application