yoklainterview sim

Mobile Rn Navigation Lifecycle Interview Questions

75 verified Mobile Rn Navigation Lifecycle interview questions — solve with answers, learn from explanations, test yourself in a real simulation.

Try the real simulation →

Sample questions

Rn Navigation LifecycleDifficulty 1
In React Navigation, which component must wrap the entire navigator tree at the root of the app?
  • aNavigationContainer
  • bSafeAreaProvider
  • cGestureHandlerRootView
  • dAppRegistry
Explanation:NavigationContainer manages the navigation tree and holds the navigation state; every navigator (stack, tab, drawer) must be nested inside exactly one NavigationContainer at the root.
Rn Navigation LifecycleDifficulty 1
What is the primary difference between navigation.navigate('Details') and navigation.push('Details') on a stack navigator?
  • apush only works with tab navigators.
  • bnavigate always resets the whole stack. regardless of whether the target screen already exists on it.
  • cThere is no difference, they are aliases.
  • dnavigate reuses an existing screen if present.
Explanation:navigate will go to an existing instance of the route already on the stack if there is one (or add it if not); push always pushes a brand new instance onto the stack, even if one already exists.
Rn Navigation LifecycleDifficulty 1
Which React Navigation hook lets a screen component know whether it is currently the focused (visible) screen?
  • auseIsFocused()
  • buseActiveScreen()
  • cuseVisibility()
  • duseScreenState()
Explanation:useIsFocused() returns a boolean that updates whenever the screen's focus state changes, letting you conditionally render or run logic only while visible.
Rn Navigation LifecycleDifficulty 1
Why does a screen component NOT unmount when the user navigates away from it to another screen on the same stack?
  • aReact Navigation always unmounts every screen on blur.
  • bIt only unmounts on Android, not iOS.
  • cThe stack keeps prior screens mounted underneath so back navigation is instant.
  • dUnmounting is controlled entirely by Redux.
Explanation:By default a stack navigator keeps previously visited screens mounted (just visually behind the new one) so that going back doesn't require re-mounting and re-fetching everything — the screen loses focus, it doesn't unmount.
Rn Navigation LifecycleDifficulty 1
What will the following screen log when the user navigates FROM this screen to another screen on the same stack (not going back)?
function ProfileScreen() {
  useFocusEffect(
    React.useCallback(() => {
      console.log('focused');
      return () => console.log('blurred');
    }, [])
  );
  return <View />;
}
  • aNothing, useFocusEffect only runs once ever.
  • b'blurred'
  • c'focused' again
  • dAn error, because the cleanup function is not allowed.
Explanation:useFocusEffect runs its callback when the screen gains focus and runs the returned cleanup function when it loses focus (blurs) — navigating away triggers the cleanup, logging 'blurred'.
Rn Navigation LifecycleDifficulty 1
Which navigator would you typically use to show a persistent set of top-level sections, each with its own icon, at the bottom of the screen?
  • acreateBottomTabNavigator
  • bcreateStackNavigator
  • ccreateDrawerNavigator
  • dcreateMaterialTopTabNavigator
Explanation:createBottomTabNavigator renders a tab bar at the bottom of the screen, ideal for switching between top-level app sections, each represented by an icon/label.

Test yourself against the 2400-question Mobile bank.

Start interview