Skip to content

replace() from formSheet presentation doesn't visually present the replacement screenΒ #3615

@marcospgp

Description

@marcospgp

Description

Calling router.replace() (or StackActions.replace()) from a screen with presentation: "formSheet" updates the navigation state but the replacement screen never visually presents. The replaced route sits dormant in the state and ghosts into view when another modal/sheet is subsequently opened.

replace() from presentation: "modal" works correctly β€” only formSheet is affected.

Reproduction

Root stack with two formSheet screens:

<Stack.Screen name="sheet-a" options={{ presentation: "formSheet", sheetAllowedDetents: "fitToContents" }} />
<Stack.Screen name="sheet-b" options={{ presentation: "formSheet", sheetAllowedDetents: "fitToContents" }} />

From sheet-a:

router.replace("/sheet-b"); // sheet-a disappears, sheet-b never appears

What happens

  1. sheet-a dismisses visually
  2. sheet-b never presents
  3. Navigation state shows sheet-b as the active route
  4. Opening any other modal/sheet later causes sheet-b to surface

Expected

sheet-b should present with formSheet appearance, replacing sheet-a.

Additional observations

  • navigate() from formSheet β†’ formSheet does present the second sheet on top, but dismissAll() doesn't properly dismiss the full stack (only topmost sheet is dismissed).
  • Workaround: dismiss() + setTimeout(() => navigate("/sheet-b"), 50) works. Synchronous dismiss() + navigate() does not β€” the navigate is swallowed.

Environment

  • react-native-screens: 4.22.0
  • react-native: 0.83.1
  • expo-router: 55.0.0-preview.5
  • iOS simulator
  • New Architecture: enabled

Also filed as expo/expo#42836

Metadata

Metadata

Assignees

No one assigned

    Labels

    Missing infoThe user didn't precise the problem enoughMissing reproThis issue need minimum repro scenario

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions