When user is clicking on EDIT icon one page will be opened. after user submit the record and if it is successful our page should come redirect to the ListCertificate.
below line will run when user click on edit button. and edit form will be opened.
<Link to={`/${props.certificate.id}/edit` }>Edit</Link>
after user saved successfully our page should redirect to ListCertificate component.
so I am writing it
.then(function (response: any) {
console.log(response);
toast(" Record updated successflly", {
position: "top-right",
autoClose: 2000,
hideProgressBar: false,
closeOnClick: true,
pauseOnHover: true,
draggable: true,
progress: undefined
});
return <Redirect to='/listcertificate' />
})
this line is not working.
return <Redirect to='/listcertificate' />
in app.js I have called ListCertificate using below.
<Route path ="/listcertificate" component={Listcertificate} ></Route>
localhost:4200/listcertificate is working properly. but it is nor getting redirect to the same page from editcomponent.