Skip to content

Commit

Permalink
Flowtype Switch
Browse files Browse the repository at this point in the history
Reviewed By: yungsters

Differential Revision: D7985880

fbshipit-source-id: eaaff2188b8257d09e1bf628d19dae6dfb4c2fc6
  • Loading branch information
elicwhite authored and facebook-github-bot committed May 14, 2018
1 parent cbe045a commit 06052a2
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions Libraries/Components/Switch/Switch.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,32 @@ const ColorPropType = require('ColorPropType');
const NativeMethodsMixin = require('NativeMethodsMixin');
const Platform = require('Platform');
const React = require('React');
const ReactNative = require('ReactNative');
const PropTypes = require('prop-types');
const StyleSheet = require('StyleSheet');
const ViewPropTypes = require('ViewPropTypes');

const createReactClass = require('create-react-class');
const requireNativeComponent = require('requireNativeComponent');

type DefaultProps = {
import type {ColorValue} from 'StyleSheetTypes';
import type {ViewProps} from 'ViewPropTypes';

type DefaultProps = $ReadOnly<{|
value: boolean,
disabled: boolean,
};
|}>;

type Props = $ReadOnly<{|
...ViewProps,
value?: ?boolean,
disabled?: ?boolean,
onValueChange?: ?Function,
testID?: ?string,
tintColor?: ?ColorValue,
onTintColor?: ?ColorValue,
thumbTintColor?: ?ColorValue,
|}>;
/**
* Renders a boolean input.
*
Expand Down Expand Up @@ -161,4 +175,4 @@ if (Platform.OS === 'android') {
});
}

module.exports = Switch;
module.exports = ((Switch: any): Class<ReactNative.NativeComponent<Props>>);

0 comments on commit 06052a2

Please sign in to comment.