saveEmployee = (e) => {
e.preventDefault();
let employee = { firstName: this.state.firstName, lastName: this.state.lastName, emailId: this.state.emailId };
console.log('employee => ' + JSON.stringify(employee));
EmployeeService.createEmployee(employee).then(res => {
this.props.history.push('/employees');
})
}
I am using react-router v6 and know that it removed history.push().What should I do? I used navigate() but don't know how to use it, maybe I used wrong.Pls help me