/** * Copyright 2004-present Facebook. All Rights Reserved. */ 'use strict'; var React = require('React'); var TabBarIOS = require('TabBarIOS'); var TabBarItemIOS = require('TabBarItemIOS'); var StyleSheet = require('StyleSheet'); var Text = require('Text'); var View = require('View'); var TabBarExample = React.createClass({ statics: { title: '', description: 'Tab-based navigation.' }, getInitialState: function() { return { selectedTab: 'redTab', notifCount: 0, presses: 0, }; }, _renderContent: function(color, pageText) { return ( {pageText} {this.state.presses} re-renders of this tab ); }, render: function() { return ( { this.setState({ selectedTab: 'blueTab', }); }}> {this._renderContent('#414A8C', 'Blue Tab')} { this.setState({ selectedTab: 'redTab', notifCount: this.state.notifCount + 1, }); }}> {this._renderContent('#783E33', 'Red Tab')} { this.setState({ selectedTab: 'greenTab', presses: this.state.presses + 1 }); }}> {this._renderContent('#21551C', 'Green Tab')} ); }, }); var styles = StyleSheet.create({ tabContent: { flex: 1, alignItems: 'center', }, tabText: { color: 'white', margin: 50, }, }); module.exports = TabBarExample;