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

255
Views
How do I change or edit the key value pairs of object using onChange event handler in React?

Initial value

const arr = {
    key1:value1,
    key2:value2,
    key3:value3
}

Output value

const arr = {
    test1:test1,
    anything2:2,
    random3:3
}

<input
    type="text"
    placeholder="name"
    name="userName"
    onChange={(e) => setUser({ ...user, [e.target.name]: e.target.value 
    })}
/>

This is the sample UI

I'm trying to use this approach but still no luck

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