How get data from material-ui TextField, DropDownMenu components?

后端 未结 10 1936
遥遥无期
遥遥无期 2021-01-31 01:13

I create form, I have several TextField, DropDownMenu material-ui components included, question is how I can collect all data from all TextFields, DropDownMenus in one obj and s

10条回答
  •  感情败类
    2021-01-31 02:03

    use the accepted answer / this was the answer to another (already deleted) question

    @karopastal

    add a ref attribute to your component and call getValue() on it, like this:

    Component:

    
    

    Using getValue:

    this.refs.myField.getValue()
    

提交回复
热议问题