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

115
Views
Problem in React typing text in a field text

This is how I have the code to save the changes

const handleChange = (e) => {
  let { Nombre, value } = e.target; 
  setState({ ...state, [Nombre]: value });
};

And in the text field I have this: The problem here is when put the field "Value", when I give the value="Nombre" it makes it impossible to write in the text field.

<Form.Group>
  <Form.Label style={{textAlign:"left"}}>Nombre</Form.Label>
  <Form.Control
    type="text"
    placeholder="Nombre"
    name="Nombre"
    value="Nombre"
    onChange={handleChange}
  />
</Form.Group>
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Issue

The issue is that you are not destructuring the correct event property to update state.

Solution

Destructure the name and value event properties. You'll also want to be in the habit of using functional state updates to update the state and avoid issues related to stale state enclosures.

Example:

const handleChange = (e) => { 
  const { name, value} = e.target; 
  setState(state => ({
    ...state,
    [name]: value
  }));
};
about 4 years ago · Juan Pablo Isaza Report
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!