Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

223
Views
React Native & TypeScript: la propiedad 'focus' no existe en el tipo 'RefObject<TextInput>'

Eso es lo que estoy haciendo:

 declare passCodeInput: React.RefObject<TextInput>;

Pero aquí hay un problema que tengo al intentar llamar al método de focus :

 setTimeout(() => this.passCodeInput.focus());

ingrese la descripción de la imagen aquí

Llamo a focus on current , como this.passCodeInput.current!.focus()) pero esto no funcionará en mi caso.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Puede usar ref como a continuación:

 import React, { useRef } from 'react' ... const MyFormComponent = () => { const ref_input2 = useRef(); const ref_input3 = useRef(); return ( <> <TextInput placeholder="Input1" autoFocus={true} returnKeyType="next" onSubmitEditing={() => ref_input2.current.focus()} /> <TextInput placeholder="Input2" returnKeyType="next" onSubmitEditing={() => ref_input3.current.focus()} ref={ref_input2} /> <TextInput placeholder="Input3" ref={ref_input3} /> </> ) }

¡Espero que te ayude!

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!