Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

264
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!