You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey everyone, I'm a little confused about best practices when navigating inside my expo app using expo-router. Is there any reason to prefer wrapping a Button with versus passing router.push to the Button's onPress?
Wrapping with Link seems more cumbersome but it also seems to be what the docs suggest doing. Imperative routing is the way to go if navigating outside of a React component. However, in a React component, is there a reason to choose one over the other?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hey everyone, I'm a little confused about best practices when navigating inside my expo app using expo-router. Is there any reason to prefer wrapping a Button with versus passing router.push to the Button's onPress?
VS
<Button onPress={() => router.navigate('/other')}
Wrapping with Link seems more cumbersome but it also seems to be what the docs suggest doing. Imperative routing is the way to go if navigating outside of a React component. However, in a React component, is there a reason to choose one over the other?
Beta Was this translation helpful? Give feedback.
All reactions