What data should be maintained by Redux

Global state and reusable state are not mentioned for the time being.
adding a page will have three pop-up windows, each of which has been extracted into a separate component.

  1. whether the status of these pop-up windows needs to be stored in redux. Three pop-up windows use three toggleShowXXX. Business logic is also redundant in action. For example, a created pop-up window is executed, the form is submitted, and the page is refreshed. These actions are all placed in action.
  2. the non-shared ready-to-use state is still placed in the state, actively invoking different action according to the business logic.

if you choose 1, there will be a large number of private action, because business logic combinations must be rarely reused.

the final question is: how to deal with the state change in the whole process from pop-up to filling out the information and submitting the form to the final refresh of the page?

Sep.08,2021

  1. if you want to save store , you can use one type, modalType , toggleModal ({modalType: 'modalOne'}) (use both on one page)
  2. when submitting the form, take the method that closes modal and execute it after processing.
Menu