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

120
Vistas
Dynamic Event Handling React JS

I am using 2 different functions to do the same thing and I am trying to merge them into one, but I am unable to do so. I read such a thing can be achieved through Dynamic Event Handling. I have tried but I failed.

Below are the two functions I want to merge

 updateProfValue(index, value) {
    this.props.profValue(index, value);
  }

 updatePersonalVaue(index, value) {
    this.props.persValue(index, value);
  }

And I want them to use in this component dynamically.

{
  abc.map((item, index) => { <
    FCW
    changeHandler = {
      this.updatePersonalVaue
    }
    defaultOption = {
      item.value
    }
    index = {
      index
    }
    key = {
      item.Cn
    }
    name = {
      item.dN
    }
    required = {
      item.r
    }
    />);
  })
}

{
  xyz.map((item, index) => { <
        FCW
        changeHandler = {
          this.updateProfVaue
        }
        defaultOption = {
          item.value
        }
        index = {
          index
        }
        key = {
          item.Cn
        }
        name = {
          item.dN
        }
        required = {
          item.r
        }
        />);

about 4 years ago · Juan Pablo Isaza
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