Questions

Before we end this chapter, let's test our knowledge with some questions:

  1. When implementing an action object, how many properties can it contain?
  2. Why did we need Redux Thunk in our Redux store?
  3. How did we make the state in our store read-only?
  4. In the questionsReducer function we implemented, why didn't we use the array push method to add the new question to the state?
case 'PostedQuestion': {
return {
...state,
unanswered: action.result
? (state.unanswered || []).push(action.result.question)
: state.unanswered,
postedResult: action.result,
};
}
  1. Does the Provider component from React Redux need to be placed at the top of the component tree?
  2. As well as the Provider component, what is the other item from React Redux that allows a component to consume data from the Redux store?
  3.  Is a component that consumes the Redux store allowed to have local state?

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.22.61.73