export const resetAndNavigate = (screenName, params = {}) => {
if (navigationRef.isReady()) {
navigationRef.reset({
index: 0,
routes: [{ name: screenName, params }],
});
}
};
Edit this fn and add navigation ref to navigation container to directly switch to screen