-
-
Notifications
You must be signed in to change notification settings - Fork 615
Open
Labels
Missing infoThe user didn't precise the problem enoughThe user didn't precise the problem enoughMissing reproThis issue need minimum repro scenarioThis issue need minimum repro scenario
Description
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 appearsWhat happens
- sheet-a dismisses visually
- sheet-b never presents
- Navigation state shows sheet-b as the active route
- 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, butdismissAll()doesn't properly dismiss the full stack (only topmost sheet is dismissed).- Workaround:
dismiss()+setTimeout(() => navigate("/sheet-b"), 50)works. Synchronousdismiss()+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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Missing infoThe user didn't precise the problem enoughThe user didn't precise the problem enoughMissing reproThis issue need minimum repro scenarioThis issue need minimum repro scenario