The state value obtained by dva when using antd's Modal.confirm is not real-time.

1. Problem: when using antd"s Modal.confirm, put an Input, to update the txNote property in state. But as long as there is a confirm, all you get is the previous state, instead of the updated state
2 entered in the confirm. Screenshot:
confirm

state

confirmconfirm

confirmstate

state

3. From top to bottom:

1.confirm
2.statetxNote""
3.confirm
4.statetxNote
5.statetxNote""

4. Follow up in the redux developer tool to see that state has been updated. Rule out the reason why state is not updated.
5. Guess:

confirmstateconfirmtxNote
Mar.03,2021

must have reset the value of state in some step.
you've guessed it, so take it one step at a time debugger .


Yes, Modal.method has this problem. It should be that it will regenerate a new Modal, parameter, that is, the state parameter at the time of generation, and will not change with the state after generation

.
Menu