-
Notifications
You must be signed in to change notification settings - Fork 53
docs: adiciona artigo introdutório sobre useState #143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
gabrielduete
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opa, @Mariachf! Tudo bem?
Muito obrigado por contribuir com o repositório 💜.
Ficou bem bacana o artigo, mas já temos um falando sobre useState no projeto. (https://github.com/Mariachf/react4noobs/blob/docs/react-hook-form/docs/Iniciando%20com%20React/8.1-useState.md)
Se quiser, pode ficar a vontade para acrescentar algo no que já existe. Tipo esse teu exemplo de erros comuns. =)
|
oie, @gabrielduete tudo sim e você? Entendo, como é a primeira vez contruibuindo para um repositório olhei apenas por cima e não vi. Obrigado pelo retorno e por avisar. 💛 |
|
Opa, Gabriel! 😊 Seguindo sua sugestão, acrescentei mais informações na seção de erros comuns do artigo de useState, mantendo o conteúdo já existente. Qualquer ajuste adicional fico à disposição. Obrigada novamente! 💜 |
gabrielduete
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Boa!! 🚀
Só coloquei um block por conta de uns tracinhos em um exemplo
| setClicks((oldState) => oldState + valorInputNumber); | ||
| } | ||
|
|
||
| --- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(block): Pode remover esses traços aqui, ficaram por cima do código hehe
| **Tentar alterar o estado diretamente (estado = novoValor)** | ||
|
|
||
| O estado nunca deve ser alterado diretamente. Sempre utilize a função retornada pelo _useState_ para atualizar o valor, garantindo a re-renderização correta do componente. | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(suggestion): Remover linha em branco
|
|
||
| A atualização de estado no React pode ser assíncrona. Por isso, o novo valor pode não estar disponível logo após a chamada da função de atualização. | ||
|
|
||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(suggestion): Remover linha em branco
Este PR adiciona um artigo introdutório sobre o hook useState, voltado para iniciantes em React.
O conteúdo aborda:
Objetivo: ajudar quem está começando a entender o gerenciamento de estado em componentes funcionais.