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

161
Visualizações
React Context is not passing 1/2 fields

So I'm learning how to use React context, I have found this example which is very helpful: https://codesandbox.io/s/login-flow-w-react-context-api-p9j96?file=/src/Login/index.js

Since useSetState can no longer be used, I tried to import useState from react, but it doesn't work the same, useState only passing password to the login function, as can be seen here:

https://codesandbox.io/s/login-flow-w-react-context-api-forked-njs1kt?file=/src/Login/index.js

Console also threw this error:

A component is changing a controlled input to be uncontrolled. This is likely caused by the value changing from a defined to undefined, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component.

Anyway I can fix this? Thank you guys so much, and happy holiday!!

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