navigate("openshift")
setTimeout(() => {
showSuccessToast('Shift Assigned');
}, 1000);
/// BUT I want in this form showsucesstoast is file in which i have set Toast detail navigate in which i am going to navigate one screen to another screen.
navigate("openshift");
showSuccessToast('Shift Assigned');
You'll need to add some delay before navigating to other screen otherwise the process would be so fast, user won't be able to see the toast. like this-
showSuccessToast('Shift Assigned');
setTimeout(() => {
navigate("openshift")
}, 1000);