Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

269
Vistas
How can I use useFormikContext hook in my class component?

I'm working with Formik forms in React Native App. I want my form to be submitted using a button that is outside the Formik component. I know how the useFormikContext hook works but the problem is with my component which is a class component (not a functional component). How can I submit my form?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

I've to use React.createRef() in order to solve my problem. I've created the ref in the constructor like this

this.myRef = React.createRef();

then I've to apply innerRef prop to my form like this

innerRef={this.myRef}

and finally I've to call submitForm method in my handleSubmit like this

this.myRef.current?.submitForm();

That's it :)

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda