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

265
Vistas
Switch text tag to input when clicking on update button in react js

i am working on a react js project and i have a user which i want to update his name when i click on a small update icon , the problem that i am displayin his name as a text and when i click on the icon i want the text to turn on to an input so i can change it then when i click on enter in keyboard or the update icon again it turns on to a text again with the new name maybe this image will make u understand more what i want to do enter image description here

I thought of 2 methods the first one is to have an input jsx tag and boolean variable and depends on this variable i change the css of the input to make it looks as a text when the variable is false and as an input if it is true

the second one is to have a p tag and an input tag and depends on the variable i make one shows and the other hidden

But i feel like there is a very much better way to do that so any help please ?

Thank you.

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