handleSubmit(e) {
        // stop browser's default behaviour of reloading on form submit
        e.preventDefault();
        axios
            .put(`/tasks/${this.props.match.params.id}`, {
                name: this.state.name
            })
            .then(response => {
                console.log("successfully edited the task");
                this.props.history.push("/");
            });
    }
// create handleSubmit method right after handleChange method
create handleSubmit method right after handleChange method
create handleSubmit method right after handleChange method
handleSubmit(e) {
        e.preventDefault();
        axios
            .put(`/tasks/${this.props.match.params.id}`, {
                name: this.state.name
            })
            .then(response => {
                console.log("successfully edited the task");
                this.props.history.push("/");
            });
    }
handleSubmit ( e ) { e . preventDefault ( ) ; axios . put ( ` ${ this . props . match . params . id } ` , { name : this . state . name } ) . then ( response => { console . log ( "successfully edited the task" ) ; this . props . history . push ( "/" ) ; } ) ; }
create handleSubmit method right after handleChange method
create handleSubmit method right after handleChange method
// stop browser's default behaviour of reloading on form submit