https://github.com/bakerface/react-navigation-options-from
Get react-navigation options from nested navigators
https://github.com/bakerface/react-navigation-options-from
Last synced: about 1 month ago
JSON representation
Get react-navigation options from nested navigators
- Host: GitHub
- URL: https://github.com/bakerface/react-navigation-options-from
- Owner: bakerface
- License: mit
- Created: 2018-05-26T01:13:26.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-05-26T01:48:25.000Z (about 8 years ago)
- Last Synced: 2025-07-02T06:50:44.678Z (about 1 year ago)
- Language: JavaScript
- Size: 2.93 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# react-navigation-options-from
Get react-navigation options from nested navigators
Created to help preserve functionality of nested navigators when upgrading to react-navigation v2. See [react-navigation #4309](https://github.com/react-navigation/react-navigation/pull/4309) for more details.
``` javascript
import getNavigationOptionsFrom from "react-navigation-options-from";
const tabs = {
MainTab: {
screen: MyHomeScreen,
path: '/',
navigationOptions: {
...
},
},
SettingsTab: {
screen: MySettingsScreen,
path: '/settings',
navigationOptions: {
...
},
},
};
const TabNav = createBottomTabNavigator(tabs, {
tabBarPosition: 'bottom',
animationEnabled: false,
swipeEnabled: false,
});
// everything above remains unchanged
// this line is added to inherit navigation options
TabNav.navigationOptions = getNavigationOptionsFrom(tabs);
const StacksOverTabs = createStackNavigator({
Root: {
screen: TabNav,
},
});
```