Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

266
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda