Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document detachInactiveScreens #859

Merged
merged 7 commits into from
Oct 26, 2020
Merged

Document detachInactiveScreens #859

merged 7 commits into from
Oct 26, 2020

Conversation

WoLewicki
Copy link
Member

@WoLewicki WoLewicki commented Sep 7, 2020

Added information about the new prop to be introduced with
react-navigation/react-navigation#8805 and react-navigation/react-navigation#8816.

@netlify
Copy link

netlify bot commented Sep 7, 2020

Deploy preview for react-navigation-docs ready!

Built with commit 5f035b0

https://deploy-preview-859--react-navigation-docs.netlify.app

Copy link
Member

@satya164 satya164 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you update the PR to reflect the changes made in v5?


Boolean used to indicate whether inactive screens should be detached from the view hierarchy to save memory. Make sure to call `enableScreens` from [react-native-screens](https://github.com/software-mansion/react-native-screens) to make it work. Defaults to `true` on Android and `false` on iOS.

#### `detachPreviousScreen`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be under options

@@ -51,6 +51,14 @@ The `Stack.Navigator` component accepts following props:

The name of the route to render on first load of the navigator.

#### `detachInactiveScreens`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move custom options to after screenOptions

@@ -49,6 +49,10 @@ The `Drawer.Navigator` component accepts following props:

The name of the route to render on first load of the navigator.

#### `detachInactiveScreens`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move custom options to after screenOptions

@@ -49,6 +49,10 @@ The `Tab.Navigator` component accepts following props:

The name of the route to render on first load of the navigator.

#### `detachInactiveScreens`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move custom options to after screenOptions

@@ -58,6 +58,8 @@ Options for the router:
- `navigationOptions` - Navigation options for the navigator itself, to configure a parent navigator
- `defaultNavigationOptions` - Default navigation options to use for screens
- `paths` - A mapping of overrides for the paths set in the route configs
- `detachInactiveScreens` - Boolean used to indicate whether inactive screens should be detached from the view hierarchy to save memory. Make sure to call `enableScreens` from [react-native-screens](https://github.com/software-mansion/react-native-screens) to make it work. Defaults to `true` on Android and `false` on iOS.
- `detachPreviousScreen` - Boolean used to indicate whether to detach the previous screen from the view hierarchy to save memory. Set it to `false` if you need the previous screen to be seen through the active screen. Only applicable if `detachInactiveScreens` isn't set to `false`. Defaults to `false` for the last screen when `mode='modal'`, otherwise `true`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move this to under navigationOptions

@@ -29,6 +29,7 @@ The route configs object is a mapping from route name to a route config, which t
## BottomTabNavigatorConfig

- `initialRouteName` - The routeName for the initial tab route when first loading.
- `detachInactiveScreens` - Boolean used to indicate whether inactive screens should be detached from the view hierarchy to save memory. Make sure to call `enableScreens` from [react-native-screens](https://github.com/software-mansion/react-native-screens) to make it work. Defaults to `true`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Place navigator related configs after the router related configs (after backBehavior)

@@ -29,6 +29,7 @@ The route configs object is a mapping from route name to a route config, which t
## BottomTabNavigatorConfig

- `initialRouteName` - The routeName for the initial tab route when first loading.
- `detachInactiveScreens` - Boolean used to indicate whether inactive screens should be detached from the view hierarchy to save memory. Make sure to call `enableScreens` from [react-native-screens](https://github.com/software-mansion/react-native-screens) to make it work. Defaults to `true`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- `detachInactiveScreens` - Boolean used to indicate whether inactive screens should be detached from the view hierarchy to save memory. Make sure to call `enableScreens` from [react-native-screens](https://github.com/software-mansion/react-native-screens) to make it work. Defaults to `true`.
- `detachInactiveScreens` - Boolean used to indicate whether inactive screens should be detached from the view hierarchy to save memory. Make sure to call `enableScreens` from [react-native-screens](https://github.com/software-mansion/react-native-screens) to make it work. Defaults to `true` on Android and `false` on iOS.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is bottom-tabs navigator not using RNScreens on iOS by default?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you mean to add this in stack-naviagtor probably?

@@ -79,6 +79,14 @@ Visual options:

String that can be used as a fallback for `headerTitle`. Additionally, will be used as a fallback for `tabBarLabel` (if nested in a TabNavigator) or `drawerLabel` (if nested in a DrawerNavigator).

#### `detachInactiveScreens`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be under StackNavigatorConfig

@satya164 satya164 changed the title feat: add info about new prop Document detachInactiveScreens Oct 26, 2020
@satya164 satya164 merged commit afbeec9 into main Oct 26, 2020
@satya164 satya164 deleted the @wolewicki/add-screens-prop branch October 26, 2020 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants