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.