Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
/**
* 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);
const fakeNavigateAction = {
fake: "Navigation/NAVIGATE",
blah: "Test1",
};
// $ExpectError not a valid action!
tabRouter.getStateForAction(fakeNavigateAction, null);
return (
);
};
const CustomTabRouter = TabRouter(
{
Home: {
screen: MyHomeScreen,
path: '',
},
Notifications: {
screen: MyNotificationsScreen,
path: 'notifications',
},
Settings: {
screen: MySettingsScreen,
path: 'settings',
},
},
{
// Change this to start on a different tab
return (
)
};
const CustomTabRouter = TabRouter({
Gank: {
screen:Gank,
navigationOptions: ()=> TabOptions('干货集中营',ShiTuIcon,ShiTuIcon,'干货集中营'),
},
ShiTu: {
screen: ShiTu,
navigationOptions: ()=> TabOptions('识兔',ShiTuIcon,ShiTuIcon,'识兔'),
},
Main:{
screen:Main,
navigationOptions: ()=> TabOptions('我的',ShiTuIcon,ShiTuIcon,'我的'),
},
}, {
// Change this to start on a different tab
initialRouteName: 'ShiTu',
tabBarPosition: 'bottom',
class CustomTabView extends React.Component {
render() {
const { navigation, descriptors } = this.props;
const { routes, index } = navigation.state;
const descriptor = descriptors[routes[index].key];
const ActiveScreen = descriptor.getComponent();
return (
);
}
}
const CustomTabRouter = TabRouter(
{
Home: {
path: '',
screen: MyHomeScreen,
},
Notifications: {
path: 'notifications',
screen: MyNotificationsScreen,
},
Settings: {
path: 'settings',
screen: MySettingsScreen,
},
},
{
// Change this to start on a different tab
import {
TabRouter,
} from 'react-navigation';
import RecentSearchesTab from './RecentSearchesTab';
import RecentStoriesTab from './RecentStoriesTab';
const HistoryTabRouter = TabRouter(
{
RecentStories: {
screen: RecentStoriesTab,
path: 'RecentStories',
},
RecentSearches: {
screen: RecentSearchesTab,
path: 'RecentSearches',
}
},
{
// Change this to start on a different tab
initialRouteName: 'RecentStories',
}
);
import {
TabRouter,
} from 'react-navigation';
import FavSearchesTab from './FavSearchesTab';
import FavStoriesTab from './FavStoriesTab';
const FavTabRouter = TabRouter(
{
FavStories: {
screen: FavStoriesTab,
path: 'FavStories',
},
FavSearches: {
screen: FavSearchesTab,
path: 'FavSearches',
}
},
{
// Change this to start on a different tab
initialRouteName: 'FavStories',
}
);
)
}
CustomTabView.propTypes = {
router: PropTypes.object.isRequired,
navigation: PropTypes.object.isRequired,
season: PropTypes.string.isRequired,
round: PropTypes.string.isRequired,
circuitId: PropTypes.string.isRequired,
date: PropTypes.string,
time: PropTypes.string
}
const CustomTabRouter = TabRouter(
{
Info: {
screen: InfoScreen,
path: '/info'
},
Qualifying: {
screen: QualifyingScreen,
path: '/qualifying'
},
Results: {
screen: ResultsScreen,
path: '/results'
}
},
{
// Change this to start on a different tab
export default (tabRoutes, options) => {
const Router = TabRouter(tabRoutes, options);
const AppNavigator = ({ navigation }) => {
return (
);
};
AppNavigator.router = Router;
AppNavigator.propTypes = {
navigation: PropTypes.object,
};
doc: 'CONTRIBUTING',
title: 'Contributors Guide',
linkName: 'Contributors',
}),
path: 'contributors',
},
})
)(NavView);
GuidesDocs.navigationOptions = {
linkName: 'Advanced Guides',
icon: 'pt-icon-manual',
};
const NavigatorsDocs = createNavigator(
TabRouter({
Navigators: {
screen: createDocPage({
doc: 'api/navigators/Navigators',
title: 'Intro to Navigators',
linkName: 'Intro to Navigators',
}),
path: '',
},
StackNavigator: {
screen: createDocPage({
doc: 'api/navigators/StackNavigator',
title: 'StackNavigator',
linkName: 'StackNavigator',
}),
path: 'stack',
},
import ChatView from './Contents/chat';
const uiTheme = {
palette: {
primaryColor: COLOR.green500,
accentColor: COLOR.pink500,
},
toolbar: {
container: {
height: 70,
paddingTop: 20
}
}
}
const TabRoute = TabRouter({
Today: { screen: TodayView },
Profile: { screen: ProfileView },
Map: { screen: MapView },
Chat: {screen: ChatView}
}, {
initialRouteName: 'Today',
}
);
class TabContentNavigator extends Component {
constructor(props, context) {
super(props, context);
this.state = {
active: props.value.active,
};
}