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

196
Vistas
How to return html string with react component's function

I have a react class component with these functions. Inside the componentDidUpdate, I would call generateHtml to get the html, and in the html, it will call bind a function called radioHandler. However, it showed an error that it could not find the function radioHandler when I click the radio button.

componentDidUpdate(){
    document.getElementById('spouseInfo').innerHTML = this.generateHtml()
}

generateHtml = () =>{
   return `<input name="${ele.$id.split("/")[3]}" onClick="${this.radioHandler}" type="radio" value="false"checked>` 
}

radioHandler = (event) => {
    // do something when click radio button
};





about 4 years ago · Santiago Trujillo
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