I'm new to react and js in general and i'm following a crash course on react on got stuck on this error at some point of the course I get this error on chrome when i open http://localhost:3000/ even when in the console it says "compiled successfully". i looked arround other topics on the site but none answerd my question
Here is the 2 files concerned
AddTodo.js
export class AddTodo extends Component {
onSubmit = (e) => {
e.preventDefault();
this.props.addTodo(this.state.title);
this.setState({ title: '' });
}
render() {
return (
<form style = {{display:'flex'}} onSubmit={this.onSubmit()} >
<input type="text" name='title' style = {{flex:'10' , padding:'5px'}} placeHolder="Ajouter une Tâche..." value={this.state.value} onChange={this.onChange}/>
<input type = "submit" value="Ajouter" className="btn" style = {{flex:'1'}} />
</form>
)}
App.js
addTodo = (title) => {const newTodo = {id : 5,title,completed : false,}
render() {
return (
<div className="App">
<div className="container">
<Header />
<AddTodo addTodo ={this.addTodo}/>
<Todos todos={this.state.todos} markComplete={this.markComplete} delTodo={this.delTodo} />
</div>
</div>
);
}