export default class TotalBayar extends Component {
submitTotalBayar = (totalBayar) => {
const pesanan = {
total_bayar: totalBayar,
menus: this.props.checkOutItem,
};
axios
.post(API_URL + 'pesanans', pesanan)
.then((res) => {
this.props.history.push('/sukses');
})
.catch((error) => {
console.log('Error: ', error);
console.error(error);
});
};
I don't understand how to replace this.props.history in react route v6