'use strict'; var React = require('react'); var ReactNative = require('react-native'); var { AppRegistry, StyleSheet, Text, View, ScrollView, TouchableOpacity } = ReactNative; var Controllers = require('react-native-controllers'); var { Modal } = Controllers; var badgeCounter = 1; var SearchScreen = React.createClass({ getInitialState: function() { return { tabBarHidden: false } }, render: function() { return ( No NavBar Example This screen isn't wrapped with a UINavigationController at all, so there's no NavBar Tabs Example Switch to Tab#1 (by tab index) Switch to Tab#1 (by content id) Styled Tab Bar Toggle tab-bar Set Badge (by tab index) Set Badge (by content id) { this.state.tabBarHidden ? Wink wink : false } ); }, onToggleTabBarClick: async function() { this.setState({ tabBarHidden: !this.state.tabBarHidden }); Controllers.TabBarControllerIOS("main").setHidden({hidden: this.state.tabBarHidden, animated: true}); }, onSwitchByIndexClick: function() { Controllers.TabBarControllerIOS("main").switchTo({ tabIndex: 0 }); }, onSwitchByIdClick: function() { Controllers.TabBarControllerIOS("main").switchTo({ contentId: "movies_nav", contentType: "NavigationControllerIOS" }); }, onBadgeByIndexClick: function() { Controllers.TabBarControllerIOS("main").setBadge({ tabIndex: 0, badge: badgeCounter++ }); }, onBadgeByIdClick: function() { Controllers.TabBarControllerIOS("main").setBadge({ contentId: "movies_nav", contentType: "NavigationControllerIOS", badge: badgeCounter++ }); }, onStyledTabsClick: function() { Modal.showController('TabStyleTester'); } }); var styles = StyleSheet.create({ container: { flex: 1, backgroundColor: '#F5FCFF' }, button: { textAlign: 'center', fontSize: 18, marginBottom: 10, marginTop:10, color: 'blue' } }); AppRegistry.registerComponent('SearchScreen', () => SearchScreen); module.exports = SearchScreen;