/** * Copyright 2004-present Facebook. All Rights Reserved. */ 'use strict'; var React = require('React'); var SwitchAndroid = require('SwitchAndroid'); var Text = require('Text'); var UIExplorerBlock = require('UIExplorerBlock'); var UIExplorerPage = require('UIExplorerPage'); var SwitchAndroidExample = React.createClass({ statics: { title: '', description: 'Standard Android two-state toggle component.' }, getInitialState : function() { return { trueSwitchIsOn: true, falseSwitchIsOn: false, colorTrueSwitchIsOn: true, colorFalseSwitchIsOn: false, eventSwitchIsOn: false, }; }, render: function() { return ( this.setState({falseSwitchIsOn: value})} style={{marginBottom: 10}} value={this.state.falseSwitchIsOn} /> this.setState({trueSwitchIsOn: value})} value={this.state.trueSwitchIsOn} /> this.setState({eventSwitchIsOn: value})} style={{marginBottom: 10}} value={this.state.eventSwitchIsOn} /> this.setState({eventSwitchIsOn: value})} style={{marginBottom: 10}} value={this.state.eventSwitchIsOn} /> {this.state.eventSwitchIsOn ? "On" : "Off"} ); } }); module.exports = SwitchAndroidExample;