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

117
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
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