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
Fix issue when emptying nav stack on Windows (#1890)
## Description
When using a `StackNavigator` on an app on Windows, when you popped the
stack you would end up with no displayed content instead of the first
page.
## Changes
The Windows stack implementation wasn't updating `Content` to the top of
the stack (after the removal and motification of the vector).
Also the Windows project had an aggressive assertion of SDK version,
causing apps to unnecessarily either download an older SDK or patch
their app. See
react-native-async-storage/async-storage#810 for
a similar fix.
## Test code and steps to reproduce
```jsx
import { NavigationContainer } from '@react-navigation/native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
// ,,,
const Stack = createNativeStackNavigator();
export default function App() : JSX.Element {
return (
<NavigationContainer>
<Stack.Navigator initialRouteName='Home'>
<Stack.Screen name='Home' component={HomeScreen} />
<Stack.Screen name='Details' component={DetailsScreen} />
</Stack.Navigator>
</NavigationContainer>
);
}
```
Somewhere else
```jsx
navigation.navigate('Details');
```
And then later
```jsx
navigation.goBack();
```
Result: rendering nothing instead of the 'Home' page.
Yep, that's all it took. As far as I can tell this was broken since
implementation, but the usage I know of on Windows was using Drawer and
that part's all fine.
## Checklist
- [x] Included code example that can be used to test this change
- [x] Updated TS types **N/A**
- [x] Updated documentation: **N/A**
- [x] Ensured that CI passes **No tests on Windows :'(**
- [x] _Tested via patch-packing in an app_
0 commit comments