Scotch.io Tutorial Questions Flashcards
What is the React Context API?
A way to pass data through the component tree without having to pass props down manually at every level
What are the 3 fundamental concepts of React?
components, virtual DOM, and JSX
What are Props?
Props, short for properties, is the data that is getting passed to the component from a parent component.
What is State?
State is data that is being managed within the component. So if each component has it’s own state, how do we share that information to another component? You could use props, but props can only be passed between parent and child components.
What is Prop Drilling?
Nested components in react where we pas info from one component to the child component, then to that component’s child.
What is the key problem React’s Context API solves?
It allows us to have a state that can be seen globally to the entire application.
What are the two components of the React Context?
to define the data you will be sending around. that grabs the data an uses it.
When not to use Context?
For larger scale apps with multiple states, reducers, etc. consider using Redux (or other) instead of Context.