How to get values from input types using this.refs in reactjs?

前端 未结 11 1296
耶瑟儿~
耶瑟儿~ 2021-02-03 21:23

Not able to get values of input type using this.refs... how to get that values from input type

   export class BusinessDetailsForm extends Component {
      subm         


        
11条回答
  •  名媛妹妹
    2021-02-03 21:55

    In 2018 you should write in constructor this: In constructor of class you should add something like this.input = React.createRef()

    Examples here: https://reactjs.org/docs/uncontrolled-components.html

提交回复
热议问题