React Native + Redux Form - Use keyboard next button to go to next TextInput field

后端 未结 5 1244
遥遥无期
遥遥无期 2021-01-05 09:56

I\'m using Redux Form (RF) in a React Native application. Everything works fine but I can not figure out how to get the refs from the Field inp

5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-05 10:29

    I worked on getting a ref like this that worked for me.

               const renderComp = ({
                 refName,
                 meta: { touched, error },
                 input,
                 ...custom
               }) => (
                 
               )
    
                
                    isLeft ? (this.compRef1 = node) : (this.compRef2 = node)}
                  refName={node =>
                     (this.myRef= node) }
                  withRef
                />
    

    now access instance functions like this.

    this.myRef.anyFunc()
    

提交回复
热议问题