Skip to content

Commit

Permalink
Merge pull request #88 from cooperka/fix-switch
Browse files Browse the repository at this point in the history
Fix references to SwitchAndroid and SwitchIOS
  • Loading branch information
cooperka authored Apr 15, 2017
2 parents 2607968 + 5ab4217 commit 5ac2807
Showing 1 changed file with 6 additions and 15 deletions.
21 changes: 6 additions & 15 deletions widgets/SwitchWidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ var React = require('react');
var {
View,
Text,
SwitchIOS,
SwitchAndroid,
Switch,
Platform,
PixelRatio
} = require('react-native')
Expand All @@ -12,19 +11,11 @@ var WidgetMixin = require('../mixins/WidgetMixin.js');

var GiftedSwitch = React.createClass({
_getSwitch() {
if (Platform.OS === 'android') {
return (
<SwitchAndroid
{...this.props}
/>
);
} else {
return (
<SwitchIOS
{...this.props}
/>
);
}
return (
<Switch
{...this.props}
/>
);
},
render() {
return (
Expand Down

0 comments on commit 5ac2807

Please sign in to comment.