- What are the similarities between context, redux, and local state?
- What is the difference between an action and an action creator in Redux?
- In your own words, what problem does context and Redux aim to solve?
- Please fill out the following table.
Tool | When should we use this over the others? |
---|---|
Context | |
Redux | |
Local state |
.5 Which of these should you prefer to use the most and why? Please give more than a one sentence answer.
Heyam, Maryam, Darya
1- They are uses for storing data in React apps.
2- We communicate with the redux store using an action. It can be of any type, but often it is an object with a payload and an action type. Action creator is a function that dynamically creates and returns functions.
3- To solve the prop drilling issue.
4-
-Context :If some values are needed on different levels of the components tree and for many elements and if you want to avoid passing down props, it will be a good idea to use context for this data.
-Redux used when you have large amounts of application state that are needed in many places in the app .
-Local state:If we're dealing with data that other parts of the application don't care about.