import React, { Component } from "react";
import "./estilo.css";
class FormularioCadastro extends Component {
contructor(){
super();
this.titulo = "";
}
handleMudancaTitulo(evento){
this.titulo = evento.target.value;
console.log(this.titulo);
}
render() {
return (
<form className="form-cadastro ">
<input
type="text"
placeholder="Título"
className="form-cadastro_input"
onChange={this.handleMudancaTitulo}
/>
<textarea
rows={15}
placeholder="Escreva sua nota..."
className="form-cadastro_input"
/>
<button className="form-cadastro_input form-cadastro_submit">
Criar Nota
</button>
</form>
);
}
}
export default FormularioCadastro;
ERRO:
ERROR in ./src/components/FormularioCadastro/FormularioCadastro.jsx
Module build failed (from ./node_modules/babel-loader/lib/index.js):
SyntaxError: C:\Users\Usabit\Desktop\LucEstudos\Front\JAVASCRIPT\React\Ceep\ceep\src\components\FormularioCadastro\FormularioCadastro.jsx: super()
is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class? (5:4)
3 | class FormularioCadastro extends Component { 4 | contructor(){
5 | super(); | ^ 6 | this.titulo = ""; 7 | } 8 | handleMudancaTitulo(evento){ at Object.raise (C:\Users\Usabit\Desktop\LucEstudos\Front\JAVASCRIPT\React\Ceep\ceep\nodemodules@babel\parser\lib\index.js:476:17) at Object.raiseWithData (C:\Users\Usabit\Desktop\LucEstudos\Front\JAVASCRIPT\React\Ceep\ceep\node_modules@babel\parser\lib\index.js:469:17) at Object.raise (C:\Users\Usabit\Desktop\LucEstudos\Front\JAVASCRIPT\React\Ceep\ceep\node_modules@babel\parser\lib\index.js:430:17) at Object.parseSuper (C:\Users\Usabit\Desktop\LucEstudos\Front\JAVASCRIPT\React\Ceep\ceep\node_modules@babel\parser\lib\index.js:12734:12) at Object.parseExprAtom (C:\Users\Usabit\Desktop\LucEstudos\Front\JAVASCRIPT\React\Ceep\ceep\node_modules@babel\parser\lib\index.js:12417:21) at Object.parseExprAtom (C:\Users\Usabit\Desktop\LucEstudos\Front\JAVASCRIPT\React\Ceep\ceep\node_modules@babel\parser\lib\index.js:7812:20) at Object.parseExprSubscripts (C:\Users\Usabit\Desktop\LucEstudos\Front\JAVASCRIPT\React\Ceep\ceep\node_modules@babel\parser\lib\index.js:12149:23)