- 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.
Names : Nina Hawari , Noor rihda , Fadi Moayed , Roza Nawzad , Hevar Tofiq
1- they all used to manage state of our datas inside the application
2- An action is an object that has two fields a type, and a payload. An action creator is a function, that just creates and returns an action
3- they both solve the lifecycle of state in our application from two main points : props drilling and state lifting
4-
context: it's better to be used with datas that have low frequency of change in the app such as theme state
Redux: better to be used with datas with high frequency of change like api data
local state: better to be used when we don't nest components that the deepest components does not depend on the parent components for the state props.
5- basically Redux because it's more optimized and it already built on context of react and solves the headache of using local state.