How does React+Antd clear all Select option boxes on the page?

how to achieve this effect:
Click the clear button, you can empty all the Select option boxes, because the values are saved in state, it is easy to simply empty the values, but how can you empty these Select boxes at the same time?

Mar.19,2021

if you are in a Form component, you can use this.props.form.resetFields () to empty all


I don't know if the answer is still useful. I have the same problem as you, but I have solved it now. The value left in Select is actually caused by its value attribute. Set this value to state, to update the state in onChange. The external clear button sets the state to empty.

Menu