Erro no código-fonte

Tell us what’s happening:
Describe your issue in detail here.

  **Your code so far**

class ControlledInput extends React.Component {
constructor(props) {
  super(props);
  this.state = {
    input: ''
  };
  // Change code below this line

  // Change code above this line
}
// Change code below this line

// Change code above this line
render() {
  return (
    <div>
      { /* Change code below this line */}

      { /* Change code above this line */}
      <h4>Controlled Input:</h4>
      <p>{this.state.input}</p>
    </div>
  );
}
};
  **Your browser information:**

User Agent is: Mozilla/5.0 (Linux; Android 8.0.0; ASUS_Z012DC) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.116 Mobile Safari/537.36 EdgA/46.06.4.5161

Challenge: Create a Controlled Input

Link to the challenge:
https://www.freecodecamp.org/learn/front-end-libraries/react/create-a-controlled-input

Oi, @lindomarolimpio . Qual é o erro nesse caso?

Mandei uma foto

Eu vi a foto, mas não entendi onde estava o erro. Você conseguiu fazer o desafio mesmo assim?

nao conseglui foi nada >
SyntaxError: desconhecido: Ponto e vírgula ausente. (8:19)

6 };
7 // Altere o código abaixo desta linha

8 | handleChange (event) {
| ^
9 this.setState ({
10 entrada: event.target.value
11 });

Tell us what’s happening:
Describe your issue in detail here.

  **Your code so far**

class ControlledInput extends React.Component {
constructor(props) {
  super(props);
  this.state = {
    input: ''
  };
  // Change code below this line

  // Change code above this line
}
// Change code below this line

// Change code above this line
render() {
  return (
    <div>
      { /* Change code below this line */}

      { /* Change code above this line */}
      <h4>Controlled Input:</h4>
      <p>{this.state.input}</p>
    </div>
  );
}
};
  **Your browser information:**

User Agent is: Mozilla/5.0 (Linux; Android 8.0.0; ASUS_Z012DC) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.116 Mobile Safari/537.36 EdgA/46.06.4.5161

Challenge: Create a Controlled Input

Link to the challenge:
https://www.freecodecamp.org/learn/front-end-libraries/react/create-a-controlled-input

Screenshots are hard to read.

Please write your code into the forum so we can assist you better.

When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (’).

Oi, @lindomarolimpio . Sugiro, pra começar, clicar em Reset All Code (Redefinir todos os códigos). Depois, ignora as linhas entre a 7 e a 9. Não coloca nada lá. Insere a função de handleChange após a linha 11, ou seja, depois da chave que fecha o construtor - no meio do segundo comentário. Por fim, insere o input depois do terceiro comentário que fica após a abertura da div. Testa novamente. Aqui, deu resultado. Eu percebi, pela foto, que seu código já está bastante grande, por isso recomendo o reset. Boa sorte e informa por aqui se deu certo. Abraço.

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.