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

前端 未结 11 1323
耶瑟儿~
耶瑟儿~ 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:42

    Using RN 0.57.8 when tried this.googleInput._getText(), It resulted in error _getText is not a function so i printed this.googleInput in console and found that _getText() is a function inside _root

    1. this.googleInput._root._getText()
    2. this.googleInput._root._lastNativeText - This will return the last state not the current state please be careful while using it.

提交回复
热议问题