Sử dụng handleSubmit ở dạng arrow function
private handleSubmit = async (e: React.FormEvent < HTMLFormElement > ): Promise<void> => {
e.preventDefault();
console.log('aaaaaaa');
}
Sử dụng handleSubmit ở dạng function
handleNewTask(e: React.FormEvent < HTMLFormElement > ): void {
e.preventDefault();
const newTask: ITask = {
id: this.getCurrentTimestamp(),
title: this.state.title,
description: this.state.description,
completed: false
};
this.setState({ title: '', description: '' });
this.props.addANewTask(newTask);
}