How do redux asynchronous requests state and props be properly controlled?

scenario:

now there is a pop-up box, and there is a button on the current page. Click the button to display the pop-up box.

there is an input form in the pop-up box. Click the submit button to request the interface after input. If the interface requests to close the pop-up box correctly, if an error is reported, toast prompts you not to close the current pop-up box.

now a field isShow is defined in the state on the page to control whether the pop-up box is hidden or displayed.

 let initState={
    error:false
}

then use componentWillReceiveProps on the page to determine the error status of the props, and then modify the isShow to control the pop-up box.

feels a little tedious.

or put the hidden display control of the pop-up box into the store of redux, and control the status of the pop-up box through props, which is more reasonable.


I feel that the logic of using redux to deal with writing is a bit of a killer. The asynchronous request is handled in the
onClick event to determine whether the modal box needs to be hidden based on the result.


<ul><li>redux</li></ul>
state={
    isShow:false
}
fetch()
.then(res => {
    if(res.code == 0){ //
      //
    }else{
    //toast 
    }
})
.catch(e => {
    //
)
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b22600-2b5f6.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b22600-2b5f6.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?