Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function createStackNavigator(routeConfigMap, stackConfig = {}) {
const router = StackRouter(routeConfigMap, stackConfig);
// Create a navigator with StackView as the view
let Navigator = createNavigator(StackView, router, stackConfig);
// if (!stackConfig.disableKeyboardHandling) {
// Navigator = createKeyboardAwareNavigator(Navigator, stackConfig);
// }
return Navigator;
}
return (
)
}
}
const SettingsSubNavigator = createNavigator(
SettingsSubNav,
StackRouter(Shim.shim(settingsSubRoutes), {initialRouteName: Constants.accountTab}),
{}
)
SettingsSubNavigator.navigationOptions = {
title: 'Settings',
}
export const newRoutes = {
// MUST use screen and not getScreen for subnavs!
settingsRoot: {screen: SettingsSubNavigator},
}
export const newModalRoutes = {
[Constants.logOutTab]: {getScreen: (): typeof LogOutTab => require('./logout/container').default},
// TODO connect broken
changePassword: {getScreen: (): typeof ChangePassword => require('./password/container').default},
deleteConfirm: {getScreen: (): typeof DeleteConfirm => require('./delete-confirm/container').default},
StackRouter(Shim.shim(routes), {
initialRouteName: tabRoots[tab],
initialRouteParams: undefined,
}),
{}
)
return map
}, {}),
{backBehavior: 'none', resetOnBlur: false}
),
{}
)
const LoggedInStackNavigator = createNavigator(
ModalView,
StackRouter(
{
Main: {screen: TabNavigator},
...Shim.shim(modalRoutes),
},
{}
),
{}
)
const LoggedOutStackNavigator = createNavigator(
AppView,
StackRouter(
{...Shim.shim(loggedOutRoutes)},
{
// @ts-ignore TODO add custom nav options somewhere
defaultNavigationOptions: () => ({headerHideBorder: true}),
import React from 'react';
const FunctionalScreenComponent = (
{ navigation }: { navigation: NavigationScreenProp<*>, ... },
) => {
return "Test";
};
const innerRouteConfig = {
Test1: { screen: FunctionalScreenComponent },
};
/**
* StackRouter
*/
const stackRouter = StackRouter(innerRouteConfig);
const stackNavigateAction = {
type: "Navigation/NAVIGATE",
routeName: "Test3",
};
stackRouter.getStateForAction(stackNavigateAction, null);
/**
* TabRouter
*/
const tabRouter = TabRouter(innerRouteConfig);
const tabNavigateAction = {
type: "Navigation/NAVIGATE",
routeName: "Test1",
};
tabRouter.getStateForAction(tabNavigateAction, null);
's Profile
<button> navigation.push('HomeScreen')}
title="Go Home"
/>
</button><button> navigation.goBack()} title="Go Back" />
);
}
}
const App = createNavigator(
Transitioner,
StackRouter({
HomeScreen,
ProfileScreen,
}),
{}
);
export default App;
</button>
's Profile
<button> navigation.push('HomeScreen')}
title="Go Home"
/>
</button><button> navigation.goBack()} title="Go Back" />
);
}
}
const App = createNavigator(
Transitioner,
StackRouter({
HomeScreen,
ProfileScreen,
}),
{}
);
export default App;
</button>
key="ModalLayer"
navigation={childNav}
component={descriptor.getComponent()}
screenProps={this.props.screenProps}
/>
)}
)
}
}
const LoggedInStackNavigator = createNavigator(
ModalView,
StackRouter(
{
Main: {screen: MainNavigator},
...Shim.shim(modalRoutes),
},
{}
),
{}
)
const LoggedOutStackNavigator = createNavigator(
AppView,
StackRouter(
{...Shim.shim(loggedOutRoutes)},
{
defaultNavigationOptions: p => ({headerHideBorder: true}),
initialRouteName: 'login',
export default function createStackTransitionNavigator(
routeConfigs,
options = {}
) {
const router = StackRouter(routeConfigs, options);
return createNavigator(Transitioner, router, options);
}
tabs.reduce((map, tab) => {
map[tab] = createNavigator(
AppView,
StackRouter(Shim.shim(routes), {
initialRouteName: tabRoots[tab],
initialRouteParams: undefined,
}),
{}
)
return map
}, {}),
{backBehavior: 'none', resetOnBlur: false}