mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-05-28 08:07:25 +08:00
Second Updates from Wed 25 Mar
- [MAdMan][Android] Make things look more Androidy | Philipp von Weitershausen - flowified Libraries from Avik | Basil Hosmer - flowify some Libraries | Basil Hosmer - [ReactKit] Add shake development menu | Alex Kotliarskyi - [ReactNative] Add debugger and change SampleApp files structure | Alex Kotliarskyi - Flowify ReactIOSEventEmitter | Marshall Roch - [react_native] JS files from D1941151: Allow fontWeight to be 100,200,...,900 | Krzysztof Magiera
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*
|
||||
* @providesModule SwitchIOS
|
||||
* @flow
|
||||
*
|
||||
* This is a controlled component version of RCTSwitch.
|
||||
*/
|
||||
@@ -23,6 +24,13 @@ var merge = require('merge');
|
||||
|
||||
var SWITCH = 'switch';
|
||||
|
||||
type DefaultProps = {
|
||||
value: boolean;
|
||||
disabled: boolean;
|
||||
};
|
||||
|
||||
type Event = Object;
|
||||
|
||||
/**
|
||||
* Use `SwitchIOS` to render a boolean input on iOS. This is
|
||||
* a controlled component, so you must hook in to the `onValueChange` callback
|
||||
@@ -67,14 +75,14 @@ var SwitchIOS = React.createClass({
|
||||
tintColor: PropTypes.string,
|
||||
},
|
||||
|
||||
getDefaultProps: function() {
|
||||
getDefaultProps: function(): DefaultProps {
|
||||
return {
|
||||
value: false,
|
||||
disabled: false,
|
||||
};
|
||||
},
|
||||
|
||||
_onChange: function(event) {
|
||||
_onChange: function(event: Event) {
|
||||
this.props.onChange && this.props.onChange(event);
|
||||
this.props.onValueChange && this.props.onValueChange(event.nativeEvent.value);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user