Im using expo router v.3. I’m accessing the ref via my global state manager in another component (screen header). Everything works in IOS as expected, but in android if i replace the route, the ref becomes null immediately and the page stays on the current page.
const showDialog = () => {
Alert.alert(
'Hey Ayo!',
'Are you sure you want to go back to home. You will loose all current progress.',
[
{
text: 'Cancel',
onPress: () => console.log('Cancel Pressed'),
style: 'cancel'
},
{
text: 'Go Home',
onPress: () => {
setCurrentMomentState({
selectedDate: 'none',
selectedMomentType: 'none'
});
(pagerViewRef.current as any).setPage(0);
router.replace('/(protected)/(tabs)/home');
}
}
]
);
Using a set-time around the set page call on android is a hacky solution.
Im using expo router v.3. I’m accessing the ref via my global state manager in another component (screen header). Everything works in IOS as expected, but in android if i replace the route, the ref becomes null immediately and the page stays on the current page.
Using a set-time around the set page call on android is a hacky solution.