Im doing a Edit in React, when i click the button i get the name on the input but im getting this error:
Warning: A component is changing an uncontrolled input of type text to be controlled. Input elements should not switch from uncontrolled to controlled (or vice versa). Decide between using a controlled or uncontrolled input element for the lifetime of the component.
Function:
editAluno(aluno) {
this.aluno = aluno.nome
this.setState({ aluno: aluno.nome })
}
HTML:
<button type="button" onClick={() => this.editAluno(aluno)}>[EDIT]</button>