React.Element<any> » React.Element<*>
Reviewed By: yungsters Differential Revision: D4027388 fbshipit-source-id: 5bc178eab1ab72283622b4b7d418f9fd43ec0792
This commit is contained in:
parent
8e2d4cc680
commit
e58d17e68b
|
@ -68,6 +68,6 @@ exports.description = 'Interface to show iOS\' accessibility samples';
|
|||
exports.examples = [
|
||||
{
|
||||
title: 'Accessibility elements',
|
||||
render(): React.Element<any> { return <AccessibilityIOSExample />; }
|
||||
render(): React.Element<*> { return <AccessibilityIOSExample />; }
|
||||
},
|
||||
];
|
||||
|
|
|
@ -197,27 +197,27 @@ exports.description = 'Interface to show iOS\' action sheets';
|
|||
exports.examples = [
|
||||
{
|
||||
title: 'Show Action Sheet',
|
||||
render(): React.Element<any> { return <ActionSheetExample />; }
|
||||
render(): React.Element<*> { return <ActionSheetExample />; }
|
||||
},
|
||||
{
|
||||
title: 'Show Action Sheet with tinted buttons',
|
||||
render(): React.Element<any> { return <ActionSheetTintExample />; }
|
||||
render(): React.Element<*> { return <ActionSheetTintExample />; }
|
||||
},
|
||||
{
|
||||
title: 'Show Share Action Sheet',
|
||||
render(): React.Element<any> {
|
||||
render(): React.Element<*> {
|
||||
return <ShareActionSheetExample url="https://code.facebook.com" />;
|
||||
}
|
||||
},
|
||||
{
|
||||
title: 'Share Local Image',
|
||||
render(): React.Element<any> {
|
||||
render(): React.Element<*> {
|
||||
return <ShareActionSheetExample url="bunny.png" />;
|
||||
}
|
||||
},
|
||||
{
|
||||
title: 'Share Screenshot',
|
||||
render(): React.Element<any> {
|
||||
render(): React.Element<*> {
|
||||
return <ShareScreenshotExample />;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ exports.description = 'Example of using the ad support API.';
|
|||
exports.examples = [
|
||||
{
|
||||
title: 'Ad Support IOS',
|
||||
render: function(): React.Element<any> {
|
||||
render: function(): React.Element<*> {
|
||||
return <AdSupportIOSExample />;
|
||||
},
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@ exports.examples = [{
|
|||
},
|
||||
{
|
||||
title: 'Prompt Options',
|
||||
render(): React.Element<any> {
|
||||
render(): React.Element<*> {
|
||||
return <PromptOptions />;
|
||||
}
|
||||
},
|
||||
|
|
|
@ -89,7 +89,7 @@ class Circle extends React.Component {
|
|||
});
|
||||
}
|
||||
|
||||
render(): React.Element<any> {
|
||||
render(): React.Element<*> {
|
||||
if (this.state.panResponder) {
|
||||
var handlers = this.state.panResponder.panHandlers;
|
||||
var dragStyle = { // Used to position while dragging
|
||||
|
@ -190,7 +190,7 @@ class AnExApp extends React.Component {
|
|||
this._onMove = this._onMove.bind(this);
|
||||
}
|
||||
|
||||
render(): React.Element<any> {
|
||||
render(): React.Element<*> {
|
||||
var circles = this.state.keys.map((key, idx) => {
|
||||
if (key === this.state.activeKey) {
|
||||
return <Circle key={key + 'd'} dummy={true} />;
|
||||
|
|
|
@ -96,7 +96,7 @@ class AnExBobble extends React.Component {
|
|||
});
|
||||
}
|
||||
|
||||
render(): React.Element<any> {
|
||||
render(): React.Element<*> {
|
||||
return (
|
||||
<View style={styles.bobbleContainer}>
|
||||
{this.state.bobbles.map((_, i) => {
|
||||
|
|
|
@ -52,7 +52,7 @@ class AnExSet extends React.Component {
|
|||
openColor: randColor(),
|
||||
};
|
||||
}
|
||||
render(): React.Element<any> {
|
||||
render(): React.Element<*> {
|
||||
var backgroundColor = this.props.openVal ?
|
||||
this.props.openVal.interpolate({
|
||||
inputRange: [0, 1],
|
||||
|
|
|
@ -97,7 +97,7 @@ class AnExTilt extends React.Component {
|
|||
this._startBurnsZoom();
|
||||
}
|
||||
|
||||
render(): React.Element<any> {
|
||||
render(): React.Element<*> {
|
||||
return (
|
||||
<Animated.View
|
||||
{...this.state.tiltPanResponder.panHandlers}
|
||||
|
|
|
@ -95,16 +95,16 @@ exports.examples = [
|
|||
{
|
||||
title: 'Subscribed AppState:',
|
||||
description: 'This changes according to the current state, so you can only ever see it rendered as "active"',
|
||||
render(): React.Element<any> { return <AppStateSubscription showCurrentOnly={true} />; }
|
||||
render(): React.Element<*> { return <AppStateSubscription showCurrentOnly={true} />; }
|
||||
},
|
||||
{
|
||||
title: 'Previous states:',
|
||||
render(): React.Element<any> { return <AppStateSubscription showCurrentOnly={false} />; }
|
||||
render(): React.Element<*> { return <AppStateSubscription showCurrentOnly={false} />; }
|
||||
},
|
||||
{
|
||||
platform: 'ios',
|
||||
title: 'Memory Warnings',
|
||||
description: 'In the IOS simulator, hit Shift+Command+M to simulate a memory warning.',
|
||||
render(): React.Element<any> { return <AppStateSubscription showMemoryWarnings={true} />; }
|
||||
render(): React.Element<*> { return <AppStateSubscription showMemoryWarnings={true} />; }
|
||||
},
|
||||
];
|
||||
|
|
|
@ -120,6 +120,6 @@ exports.description = 'Asynchronous local disk storage.';
|
|||
exports.examples = [
|
||||
{
|
||||
title: 'Basics - getItem, setItem, removeItem',
|
||||
render(): React.Element<any> { return <BasicStorageExample />; }
|
||||
render(): React.Element<*> { return <BasicStorageExample />; }
|
||||
},
|
||||
];
|
||||
|
|
|
@ -143,6 +143,6 @@ exports.description = 'Example component that uses CameraRoll to list user\'s ph
|
|||
exports.examples = [
|
||||
{
|
||||
title: 'Photos',
|
||||
render(): React.Element<any> { return <CameraRollExample />; }
|
||||
render(): React.Element<*> { return <CameraRollExample />; }
|
||||
}
|
||||
];
|
||||
|
|
|
@ -135,7 +135,7 @@ exports.description = 'Select dates and times using the native UIDatePicker.';
|
|||
exports.examples = [
|
||||
{
|
||||
title: '<DatePickerIOS>',
|
||||
render: function(): React.Element<any> {
|
||||
render: function(): React.Element<*> {
|
||||
return <DatePickerExample />;
|
||||
},
|
||||
}];
|
||||
|
|
|
@ -27,7 +27,7 @@ import type React from 'react';
|
|||
|
||||
export type Example = {
|
||||
title: string,
|
||||
render: () => ?React.Element<any>,
|
||||
render: () => ?React.Element<*>,
|
||||
description?: string,
|
||||
platform?: string,
|
||||
};
|
||||
|
|
|
@ -39,7 +39,7 @@ exports.description = 'Examples of using the Geolocation API.';
|
|||
exports.examples = [
|
||||
{
|
||||
title: 'navigator.geolocation',
|
||||
render: function(): React.Element<any> {
|
||||
render: function(): React.Element<*> {
|
||||
return <GeolocationExample />;
|
||||
},
|
||||
}
|
||||
|
|
|
@ -161,12 +161,12 @@ exports.title = 'Layout Animation';
|
|||
exports.description = 'Layout animation';
|
||||
exports.examples = [{
|
||||
title: 'Add and remove views',
|
||||
render(): React.Element<any> {
|
||||
render(): React.Element<*> {
|
||||
return <AddRemoveExample />;
|
||||
},
|
||||
}, {
|
||||
title: 'Cross fade views',
|
||||
render(): React.Element<any> {
|
||||
render(): React.Element<*> {
|
||||
return <CrossFadeExample />;
|
||||
},
|
||||
}];
|
||||
|
|
|
@ -170,7 +170,7 @@ exports.description = 'Examples that show how Layout events can be used to ' +
|
|||
exports.examples = [
|
||||
{
|
||||
title: 'LayoutEventExample',
|
||||
render: function(): React.Element<any> {
|
||||
render: function(): React.Element<*> {
|
||||
return <LayoutEventExample />;
|
||||
},
|
||||
}];
|
||||
|
|
|
@ -142,7 +142,7 @@ class ListViewPagingExample extends React.Component {
|
|||
};
|
||||
}
|
||||
|
||||
renderRow = (rowData: string, sectionID: string, rowID: string): React.Element<any> => {
|
||||
renderRow = (rowData: string, sectionID: string, rowID: string): React.Element<*> => {
|
||||
return (<Thumb text={rowData}/>);
|
||||
};
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@ class Example extends Component {
|
|||
this.state = reducer();
|
||||
}
|
||||
|
||||
render(): React.Element<any> {
|
||||
render(): React.Element<*> {
|
||||
return (
|
||||
<ExampleNavigator
|
||||
navigationState={this.state}
|
||||
|
@ -128,7 +128,7 @@ class ExampleNavigator extends Component {
|
|||
navigate: PropTypes.func.isRequired,
|
||||
};
|
||||
|
||||
render(): React.Element<any> {
|
||||
render(): React.Element<*> {
|
||||
return (
|
||||
<NavigationTransitioner
|
||||
navigationState={this.props.navigationState}
|
||||
|
@ -140,7 +140,7 @@ class ExampleNavigator extends Component {
|
|||
|
||||
_render(
|
||||
transitionProps: NavigationTransitionProps,
|
||||
): Array<React.Element<any>> {
|
||||
): Array<React.Element<*>> {
|
||||
return transitionProps.scenes.map((scene) => {
|
||||
const sceneProps = {
|
||||
...transitionProps,
|
||||
|
@ -152,7 +152,7 @@ class ExampleNavigator extends Component {
|
|||
|
||||
_renderScene(
|
||||
sceneProps: NavigationSceneRendererProps,
|
||||
): React.Element<any> {
|
||||
): React.Element<*> {
|
||||
return (
|
||||
<ExampleScene
|
||||
{...sceneProps}
|
||||
|
@ -181,7 +181,7 @@ class ExampleScene extends Component {
|
|||
navigate: PropTypes.func.isRequired,
|
||||
};
|
||||
|
||||
render(): React.Element<any> {
|
||||
render(): React.Element<*> {
|
||||
const {scene, navigate} = this.props;
|
||||
return (
|
||||
<Animated.View
|
||||
|
|
|
@ -95,7 +95,7 @@ class Example extends Component {
|
|||
this.state = reducer();
|
||||
}
|
||||
|
||||
render(): React.Element<any> {
|
||||
render(): React.Element<*> {
|
||||
return (
|
||||
<View style={styles.example}>
|
||||
<ExampleNavigator
|
||||
|
@ -154,7 +154,7 @@ class ExampleNavigator extends Component {
|
|||
this._renderScene = this._renderScene.bind(this);
|
||||
}
|
||||
|
||||
render(): React.Element<any> {
|
||||
render(): React.Element<*> {
|
||||
return (
|
||||
<NavigationTransitioner
|
||||
navigationState={this.props.navigationState}
|
||||
|
@ -165,7 +165,7 @@ class ExampleNavigator extends Component {
|
|||
|
||||
_render(
|
||||
transitionProps: NavigationTransitionProps,
|
||||
): React.Element<any> {
|
||||
): React.Element<*> {
|
||||
const scenes = transitionProps.scenes.map((scene) => {
|
||||
const sceneProps = {
|
||||
...transitionProps,
|
||||
|
@ -182,7 +182,7 @@ class ExampleNavigator extends Component {
|
|||
|
||||
_renderScene(
|
||||
sceneProps: NavigationSceneRendererProps,
|
||||
): React.Element<any> {
|
||||
): React.Element<*> {
|
||||
return (
|
||||
<ExampleScene
|
||||
{...sceneProps}
|
||||
|
@ -203,7 +203,7 @@ class ExampleScene extends Component {
|
|||
navigate: PropTypes.func.isRequired,
|
||||
};
|
||||
|
||||
render(): React.Element<any> {
|
||||
render(): React.Element<*> {
|
||||
const {scene, navigate} = this.props;
|
||||
|
||||
const panHandlers = NavigationPagerPanResponder.forHorizontal({
|
||||
|
|
|
@ -175,22 +175,22 @@ exports.examples = [
|
|||
{
|
||||
title: 'NetInfo.isConnected',
|
||||
description: 'Asynchronously load and observe connectivity',
|
||||
render(): React.Element<any> { return <IsConnected />; }
|
||||
render(): React.Element<*> { return <IsConnected />; }
|
||||
},
|
||||
{
|
||||
title: 'NetInfo.update',
|
||||
description: 'Asynchronously load and observe connectionInfo',
|
||||
render(): React.Element<any> { return <ConnectionInfoCurrent />; }
|
||||
render(): React.Element<*> { return <ConnectionInfoCurrent />; }
|
||||
},
|
||||
{
|
||||
title: 'NetInfo.updateHistory',
|
||||
description: 'Observed updates to connectionInfo',
|
||||
render(): React.Element<any> { return <ConnectionInfoSubscription />; }
|
||||
render(): React.Element<*> { return <ConnectionInfoSubscription />; }
|
||||
},
|
||||
{
|
||||
platform: 'android',
|
||||
title: 'NetInfo.isConnectionExpensive (Android)',
|
||||
description: 'Asynchronously check isConnectionExpensive',
|
||||
render(): React.Element<any> { return <IsConnectionExpensive />; }
|
||||
render(): React.Element<*> { return <IsConnectionExpensive />; }
|
||||
},
|
||||
];
|
||||
|
|
|
@ -147,13 +147,13 @@ exports.description = 'Render lists of selectable options with UIPickerView.';
|
|||
exports.examples = [
|
||||
{
|
||||
title: '<PickerIOS>',
|
||||
render: function(): React.Element<any> {
|
||||
render: function(): React.Element<*> {
|
||||
return <PickerExample />;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '<PickerIOS> with custom styling',
|
||||
render: function(): React.Element<any> {
|
||||
render: function(): React.Element<*> {
|
||||
return <PickerStyleExample />;
|
||||
},
|
||||
}];
|
||||
|
|
|
@ -193,7 +193,7 @@ exports.description = 'Apple PushNotification and badge value';
|
|||
exports.examples = [
|
||||
{
|
||||
title: 'Badge Number',
|
||||
render(): React.Element<any> {
|
||||
render(): React.Element<*> {
|
||||
return (
|
||||
<View>
|
||||
<Button
|
||||
|
@ -210,13 +210,13 @@ exports.examples = [
|
|||
},
|
||||
{
|
||||
title: 'Push Notifications',
|
||||
render(): React.Element<any> {
|
||||
render(): React.Element<*> {
|
||||
return <NotificationExample />;
|
||||
}
|
||||
},
|
||||
{
|
||||
title: 'Notifications Permissions',
|
||||
render(): React.Element<any> {
|
||||
render(): React.Element<*> {
|
||||
return <NotificationPermissionExample />;
|
||||
}
|
||||
}];
|
||||
|
|
|
@ -90,7 +90,7 @@ exports.description = 'Examples that show useful methods when embedding React Na
|
|||
exports.examples = [
|
||||
{
|
||||
title: 'Updating app properties in runtime',
|
||||
render(): React.Element<any> {
|
||||
render(): React.Element<*> {
|
||||
return (
|
||||
<AppPropertiesUpdateExample/>
|
||||
);
|
||||
|
@ -98,7 +98,7 @@ exports.examples = [
|
|||
},
|
||||
{
|
||||
title: 'RCTRootView\'s size flexibility',
|
||||
render(): React.Element<any> {
|
||||
render(): React.Element<*> {
|
||||
return (
|
||||
<RootViewSizeFlexibilityExample/>
|
||||
);
|
||||
|
|
|
@ -150,26 +150,26 @@ exports.description = 'Native segmented control';
|
|||
exports.examples = [
|
||||
{
|
||||
title: 'Segmented controls can have values',
|
||||
render(): React.Element<any> { return <BasicSegmentedControlExample />; }
|
||||
render(): React.Element<*> { return <BasicSegmentedControlExample />; }
|
||||
},
|
||||
{
|
||||
title: 'Segmented controls can have a pre-selected value',
|
||||
render(): React.Element<any> { return <PreSelectedSegmentedControlExample />; }
|
||||
render(): React.Element<*> { return <PreSelectedSegmentedControlExample />; }
|
||||
},
|
||||
{
|
||||
title: 'Segmented controls can be momentary',
|
||||
render(): React.Element<any> { return <MomentarySegmentedControlExample />; }
|
||||
render(): React.Element<*> { return <MomentarySegmentedControlExample />; }
|
||||
},
|
||||
{
|
||||
title: 'Segmented controls can be disabled',
|
||||
render(): React.Element<any> { return <DisabledSegmentedControlExample />; }
|
||||
render(): React.Element<*> { return <DisabledSegmentedControlExample />; }
|
||||
},
|
||||
{
|
||||
title: 'Custom colors can be provided',
|
||||
render(): React.Element<any> { return <ColorSegmentedControlExample />; }
|
||||
render(): React.Element<*> { return <ColorSegmentedControlExample />; }
|
||||
},
|
||||
{
|
||||
title: 'Change events can be detected',
|
||||
render(): React.Element<any> { return <EventSegmentedControlExample />; }
|
||||
render(): React.Element<*> { return <EventSegmentedControlExample />; }
|
||||
}
|
||||
];
|
||||
|
|
|
@ -95,19 +95,19 @@ exports.description = 'Slider input for numeric values';
|
|||
exports.examples = [
|
||||
{
|
||||
title: 'Default settings',
|
||||
render(): React.Element<any> {
|
||||
render(): React.Element<*> {
|
||||
return <SliderExample />;
|
||||
}
|
||||
},
|
||||
{
|
||||
title: 'Initial value: 0.5',
|
||||
render(): React.Element<any> {
|
||||
render(): React.Element<*> {
|
||||
return <SliderExample value={0.5} />;
|
||||
}
|
||||
},
|
||||
{
|
||||
title: 'minimumValue: -1, maximumValue: 2',
|
||||
render(): React.Element<any> {
|
||||
render(): React.Element<*> {
|
||||
return (
|
||||
<SliderExample
|
||||
minimumValue={-1}
|
||||
|
@ -118,13 +118,13 @@ exports.examples = [
|
|||
},
|
||||
{
|
||||
title: 'step: 0.25',
|
||||
render(): React.Element<any> {
|
||||
render(): React.Element<*> {
|
||||
return <SliderExample step={0.25} />;
|
||||
}
|
||||
},
|
||||
{
|
||||
title: 'onSlidingComplete',
|
||||
render(): React.Element<any> {
|
||||
render(): React.Element<*> {
|
||||
return (
|
||||
<SlidingCompleteExample />
|
||||
);
|
||||
|
@ -133,7 +133,7 @@ exports.examples = [
|
|||
{
|
||||
title: 'Custom min/max track tint color',
|
||||
platform: 'ios',
|
||||
render(): React.Element<any> {
|
||||
render(): React.Element<*> {
|
||||
return (
|
||||
<SliderExample
|
||||
minimumTrackTintColor={'red'}
|
||||
|
@ -145,21 +145,21 @@ exports.examples = [
|
|||
{
|
||||
title: 'Custom thumb image',
|
||||
platform: 'ios',
|
||||
render(): React.Element<any> {
|
||||
render(): React.Element<*> {
|
||||
return <SliderExample thumbImage={require('./uie_thumb_big.png')} />;
|
||||
}
|
||||
},
|
||||
{
|
||||
title: 'Custom track image',
|
||||
platform: 'ios',
|
||||
render(): React.Element<any> {
|
||||
render(): React.Element<*> {
|
||||
return <SliderExample trackImage={require('./slider.png')} />;
|
||||
}
|
||||
},
|
||||
{
|
||||
title: 'Custom min/max track image',
|
||||
platform: 'ios',
|
||||
render(): React.Element<any> {
|
||||
render(): React.Element<*> {
|
||||
return (
|
||||
<SliderExample
|
||||
minimumTrackImage={require('./slider-left.png')}
|
||||
|
|
|
@ -74,6 +74,6 @@ exports.description = 'API to capture images from the screen.';
|
|||
exports.examples = [
|
||||
{
|
||||
title: 'Take screenshot',
|
||||
render(): React.Element<any> { return <ScreenshotExample />; }
|
||||
render(): React.Element<*> { return <ScreenshotExample />; }
|
||||
},
|
||||
];
|
||||
|
|
|
@ -134,26 +134,26 @@ class EventSwitchExample extends React.Component {
|
|||
var examples = [
|
||||
{
|
||||
title: 'Switches can be set to true or false',
|
||||
render(): React.Element<any> { return <BasicSwitchExample />; }
|
||||
render(): React.Element<*> { return <BasicSwitchExample />; }
|
||||
},
|
||||
{
|
||||
title: 'Switches can be disabled',
|
||||
render(): React.Element<any> { return <DisabledSwitchExample />; }
|
||||
render(): React.Element<*> { return <DisabledSwitchExample />; }
|
||||
},
|
||||
{
|
||||
title: 'Change events can be detected',
|
||||
render(): React.Element<any> { return <EventSwitchExample />; }
|
||||
render(): React.Element<*> { return <EventSwitchExample />; }
|
||||
},
|
||||
{
|
||||
title: 'Switches are controlled components',
|
||||
render(): React.Element<any> { return <Switch />; }
|
||||
render(): React.Element<*> { return <Switch />; }
|
||||
}
|
||||
];
|
||||
|
||||
if (Platform.OS === 'ios') {
|
||||
examples.push({
|
||||
title: 'Custom colors can be provided',
|
||||
render(): React.Element<any> { return <ColorSwitchExample />; }
|
||||
render(): React.Element<*> { return <ColorSwitchExample />; }
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -433,7 +433,7 @@ exports.examples = [
|
|||
},
|
||||
}, {
|
||||
title: 'Toggling Attributes',
|
||||
render: function(): React.Element<any> {
|
||||
render: function(): React.Element<*> {
|
||||
return <AttributeToggler />;
|
||||
},
|
||||
}, {
|
||||
|
@ -575,7 +575,7 @@ exports.examples = [
|
|||
},
|
||||
}, {
|
||||
title: 'Dynamic Font Size Adjustment',
|
||||
render: function(): React.Element<any> {
|
||||
render: function(): React.Element<*> {
|
||||
return <AdjustingFontSize />;
|
||||
},
|
||||
}];
|
||||
|
|
|
@ -627,7 +627,7 @@ exports.examples = [
|
|||
},
|
||||
{
|
||||
title: 'Event handling',
|
||||
render: function(): React.Element<any> { return <TextEventsExample />; },
|
||||
render: function(): React.Element<*> { return <TextEventsExample />; },
|
||||
},
|
||||
{
|
||||
title: 'Colored input text',
|
||||
|
@ -725,7 +725,7 @@ exports.examples = [
|
|||
},
|
||||
{
|
||||
title: 'Blur on submit',
|
||||
render: function(): React.Element<any> { return <BlurOnSubmitExample />; },
|
||||
render: function(): React.Element<*> { return <BlurOnSubmitExample />; },
|
||||
},
|
||||
{
|
||||
title: 'Multiline blur on submit',
|
||||
|
|
|
@ -242,7 +242,7 @@ exports.examples = [
|
|||
title: 'this.setInterval(fn, t)',
|
||||
description: 'Execute function fn every t milliseconds until cancelled ' +
|
||||
'or component is unmounted.',
|
||||
render: function(): React.Element<any> {
|
||||
render: function(): React.Element<*> {
|
||||
class IntervalExample extends React.Component {
|
||||
state = {
|
||||
showTimer: true,
|
||||
|
|
|
@ -78,14 +78,14 @@ exports.examples = [
|
|||
},
|
||||
}, {
|
||||
title: '<Text onPress={fn}> with highlight',
|
||||
render: function(): React.Element<any> {
|
||||
render: function(): React.Element<*> {
|
||||
return <TextOnPressBox />;
|
||||
},
|
||||
}, {
|
||||
title: 'Touchable feedback events',
|
||||
description: '<Touchable*> components accept onPress, onPressIn, ' +
|
||||
'onPressOut, and onLongPress as props.',
|
||||
render: function(): React.Element<any> {
|
||||
render: function(): React.Element<*> {
|
||||
return <TouchableFeedbackEvents />;
|
||||
},
|
||||
}, {
|
||||
|
@ -93,13 +93,13 @@ exports.examples = [
|
|||
description: '<Touchable*> components also accept delayPressIn, ' +
|
||||
'delayPressOut, and delayLongPress as props. These props impact the ' +
|
||||
'timing of feedback events.',
|
||||
render: function(): React.Element<any> {
|
||||
render: function(): React.Element<*> {
|
||||
return <TouchableDelayEvents />;
|
||||
},
|
||||
}, {
|
||||
title: '3D Touch / Force Touch',
|
||||
description: 'iPhone 6s and 6s plus support 3D touch, which adds a force property to touches',
|
||||
render: function(): React.Element<any> {
|
||||
render: function(): React.Element<*> {
|
||||
return <ForceTouchExample />;
|
||||
},
|
||||
platform: 'ios',
|
||||
|
@ -107,14 +107,14 @@ exports.examples = [
|
|||
title: 'Touchable Hit Slop',
|
||||
description: '<Touchable*> components accept hitSlop prop which extends the touch area ' +
|
||||
'without changing the view bounds.',
|
||||
render: function(): React.Element<any> {
|
||||
render: function(): React.Element<*> {
|
||||
return <TouchableHitSlop />;
|
||||
},
|
||||
}, {
|
||||
title: 'Disabled Touchable*',
|
||||
description: '<Touchable*> components accept disabled prop which prevents ' +
|
||||
'any interaction with component',
|
||||
render: function(): React.Element<any> {
|
||||
render: function(): React.Element<*> {
|
||||
return <TouchableDisabled />;
|
||||
},
|
||||
}];
|
||||
|
|
|
@ -213,7 +213,7 @@ exports.examples = [
|
|||
{
|
||||
title: 'Perspective',
|
||||
description: 'perspective: 850, rotateX: Animated.timing(0 -> 360)',
|
||||
render(): React.Element<any> { return <Flip />; }
|
||||
render(): React.Element<*> { return <Flip />; }
|
||||
},
|
||||
{
|
||||
title: 'Translate, Rotate, Scale',
|
||||
|
|
|
@ -46,6 +46,6 @@ exports.description = 'Transparent view receiving touch events';
|
|||
exports.examples = [
|
||||
{
|
||||
title: 'TransparentHitTestExample',
|
||||
render(): React.Element<any> { return <TransparentHitTestExample />; }
|
||||
render(): React.Element<*> { return <TransparentHitTestExample />; }
|
||||
}
|
||||
];
|
||||
|
|
|
@ -145,7 +145,7 @@ class UIExplorerApp extends React.Component {
|
|||
);
|
||||
}
|
||||
|
||||
_renderHeader(props: NavigationSceneRendererProps): React.Element<any> {
|
||||
_renderHeader(props: NavigationSceneRendererProps): React.Element<*> {
|
||||
return (
|
||||
<NavigationHeader
|
||||
{...props}
|
||||
|
@ -155,7 +155,7 @@ class UIExplorerApp extends React.Component {
|
|||
);
|
||||
}
|
||||
|
||||
_renderTitleComponent(props: NavigationSceneRendererProps): React.Element<any> {
|
||||
_renderTitleComponent(props: NavigationSceneRendererProps): React.Element<*> {
|
||||
return (
|
||||
<NavigationHeader.Title>
|
||||
{UIExplorerStateTitleMap(props.scene.route)}
|
||||
|
@ -163,7 +163,7 @@ class UIExplorerApp extends React.Component {
|
|||
);
|
||||
}
|
||||
|
||||
_renderScene(props: NavigationSceneRendererProps): ?React.Element<any> {
|
||||
_renderScene(props: NavigationSceneRendererProps): ?React.Element<*> {
|
||||
const state = props.scene.route;
|
||||
if (state.key === 'AppList') {
|
||||
return (
|
||||
|
|
|
@ -51,7 +51,7 @@ class UIExplorerExampleContainer extends React.Component {
|
|||
);
|
||||
}
|
||||
|
||||
render(): React.Element<any> {
|
||||
render(): React.Element<*> {
|
||||
if (!this.props.module.examples) {
|
||||
return <this.props.module />;
|
||||
}
|
||||
|
|
|
@ -63,7 +63,7 @@ type Props = {
|
|||
class UIExplorerExampleList extends React.Component {
|
||||
props: Props
|
||||
|
||||
render(): ?React.Element<any> {
|
||||
render(): ?React.Element<*> {
|
||||
const filterText = this.props.persister.state.filter;
|
||||
const filterRegex = new RegExp(String(filterText), 'i');
|
||||
const filter = (example) => filterRegex.test(example.module.title);
|
||||
|
@ -90,7 +90,7 @@ class UIExplorerExampleList extends React.Component {
|
|||
);
|
||||
}
|
||||
|
||||
_renderTitleRow(): ?React.Element<any> {
|
||||
_renderTitleRow(): ?React.Element<*> {
|
||||
if (!this.props.displayTitleRow) {
|
||||
return null;
|
||||
}
|
||||
|
@ -106,7 +106,7 @@ class UIExplorerExampleList extends React.Component {
|
|||
);
|
||||
}
|
||||
|
||||
_renderTextInput(): ?React.Element<any> {
|
||||
_renderTextInput(): ?React.Element<*> {
|
||||
if (this.props.disableSearch) {
|
||||
return null;
|
||||
}
|
||||
|
@ -129,7 +129,7 @@ class UIExplorerExampleList extends React.Component {
|
|||
);
|
||||
}
|
||||
|
||||
_renderSectionHeader(data: any, section: string): ?React.Element<any> {
|
||||
_renderSectionHeader(data: any, section: string): ?React.Element<*> {
|
||||
return (
|
||||
<Text style={styles.sectionHeader}>
|
||||
{section.toUpperCase()}
|
||||
|
@ -137,7 +137,7 @@ class UIExplorerExampleList extends React.Component {
|
|||
);
|
||||
}
|
||||
|
||||
_renderExampleRow(example: {key: string, module: Object}): ?React.Element<any> {
|
||||
_renderExampleRow(example: {key: string, module: Object}): ?React.Element<*> {
|
||||
return this._renderRow(
|
||||
example.module.title,
|
||||
example.module.description,
|
||||
|
@ -146,7 +146,7 @@ class UIExplorerExampleList extends React.Component {
|
|||
);
|
||||
}
|
||||
|
||||
_renderRow(title: string, description: string, key: ?string, handler: ?Function): ?React.Element<any> {
|
||||
_renderRow(title: string, description: string, key: ?string, handler: ?Function): ?React.Element<*> {
|
||||
return (
|
||||
<View key={key || title}>
|
||||
<TouchableHighlight onPress={handler}>
|
||||
|
|
|
@ -50,7 +50,7 @@ const WS_STATES = [
|
|||
];
|
||||
|
||||
class Button extends React.Component {
|
||||
render(): React.Element<any> {
|
||||
render(): React.Element<*> {
|
||||
const label = <Text style={styles.buttonLabel}>{this.props.label}</Text>;
|
||||
if (this.props.disabled) {
|
||||
return (
|
||||
|
@ -70,7 +70,7 @@ class Button extends React.Component {
|
|||
}
|
||||
|
||||
class Row extends React.Component {
|
||||
render(): React.Element<any> {
|
||||
render(): React.Element<*> {
|
||||
return (
|
||||
<View style={styles.row}>
|
||||
<Text>{this.props.label}</Text>
|
||||
|
@ -169,7 +169,7 @@ class WebSocketExample extends React.Component<any, any, State> {
|
|||
this.setState({outgoingMessage: ''});
|
||||
};
|
||||
|
||||
render(): React.Element<any> {
|
||||
render(): React.Element<*> {
|
||||
const socketState = WS_STATES[this.state.socketState || -1];
|
||||
const canConnect =
|
||||
!this.state.socket ||
|
||||
|
|
|
@ -337,15 +337,15 @@ exports.description = 'Base component to display web content';
|
|||
exports.examples = [
|
||||
{
|
||||
title: 'Simple Browser',
|
||||
render(): React.Element<any> { return <WebViewExample />; }
|
||||
render(): React.Element<*> { return <WebViewExample />; }
|
||||
},
|
||||
{
|
||||
title: 'Scale Page to Fit',
|
||||
render(): React.Element<any> { return <ScaledWebView/>; }
|
||||
render(): React.Element<*> { return <ScaledWebView/>; }
|
||||
},
|
||||
{
|
||||
title: 'Bundled HTML',
|
||||
render(): React.Element<any> {
|
||||
render(): React.Element<*> {
|
||||
return (
|
||||
<WebView
|
||||
style={{
|
||||
|
@ -360,7 +360,7 @@ exports.examples = [
|
|||
},
|
||||
{
|
||||
title: 'Static HTML',
|
||||
render(): React.Element<any> {
|
||||
render(): React.Element<*> {
|
||||
return (
|
||||
<WebView
|
||||
style={{
|
||||
|
@ -375,7 +375,7 @@ exports.examples = [
|
|||
},
|
||||
{
|
||||
title: 'POST Test',
|
||||
render(): React.Element<any> {
|
||||
render(): React.Element<*> {
|
||||
return (
|
||||
<WebView
|
||||
style={{
|
||||
|
|
|
@ -65,7 +65,7 @@ class PromiseTest extends React.Component {
|
|||
}
|
||||
};
|
||||
|
||||
render(): React.Element<any> {
|
||||
render(): React.Element<*> {
|
||||
return <View />;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -149,7 +149,7 @@ const KeyboardAvoidingView = React.createClass({
|
|||
this.subscriptions.forEach((sub) => sub.remove());
|
||||
},
|
||||
|
||||
render(): React.Element<any> {
|
||||
render(): React.Element<*> {
|
||||
const {behavior, children, style, ...props} = this.props;
|
||||
|
||||
switch (behavior) {
|
||||
|
|
|
@ -28,7 +28,7 @@ class StaticRenderer extends React.Component {
|
|||
return nextProps.shouldUpdate;
|
||||
}
|
||||
|
||||
render(): React.Element<any> {
|
||||
render(): React.Element<*> {
|
||||
return this.props.render();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -386,7 +386,7 @@ class StatusBar extends React.Component {
|
|||
});
|
||||
};
|
||||
|
||||
render(): ?React.Element<any> {
|
||||
render(): ?React.Element<*> {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -131,7 +131,7 @@ var TouchableBounce = React.createClass({
|
|||
return 0;
|
||||
},
|
||||
|
||||
render: function(): React.Element<any> {
|
||||
render: function(): React.Element<*> {
|
||||
return (
|
||||
<Animated.View
|
||||
style={[{transform: [{scale: this.state.scale}]}, this.props.style]}
|
||||
|
|
|
@ -147,7 +147,7 @@ const TouchableWithoutFeedback = React.createClass({
|
|||
return this.props.delayPressOut || 0;
|
||||
},
|
||||
|
||||
render: function(): React.Element<any> {
|
||||
render: function(): React.Element<*> {
|
||||
// Note(avik): remove dynamic typecast once Flow has been upgraded
|
||||
const child = React.Children.only(this.props.children);
|
||||
let children = child.props.children;
|
||||
|
|
|
@ -76,7 +76,7 @@ class NavigationCard extends React.Component<any, Props, any> {
|
|||
style: PropTypes.any,
|
||||
};
|
||||
|
||||
render(): React.Element<any> {
|
||||
render(): React.Element<*> {
|
||||
const {
|
||||
panHandlers,
|
||||
pointerEvents,
|
||||
|
|
|
@ -202,7 +202,7 @@ class NavigationCardStack extends React.Component<DefaultProps, Props, void> {
|
|||
this._renderScene = this._renderScene.bind(this);
|
||||
}
|
||||
|
||||
render(): React.Element<any> {
|
||||
render(): React.Element<*> {
|
||||
return (
|
||||
<NavigationTransitioner
|
||||
navigationState={this.props.navigationState}
|
||||
|
@ -212,7 +212,7 @@ class NavigationCardStack extends React.Component<DefaultProps, Props, void> {
|
|||
);
|
||||
}
|
||||
|
||||
_render(props: NavigationTransitionProps): React.Element<any> {
|
||||
_render(props: NavigationTransitionProps): React.Element<*> {
|
||||
const {
|
||||
renderHeader
|
||||
} = this.props;
|
||||
|
@ -237,7 +237,7 @@ class NavigationCardStack extends React.Component<DefaultProps, Props, void> {
|
|||
);
|
||||
}
|
||||
|
||||
_renderScene(props: NavigationSceneRendererProps): React.Element<any> {
|
||||
_renderScene(props: NavigationSceneRendererProps): React.Element<*> {
|
||||
const isVertical = this.props.direction === 'vertical';
|
||||
|
||||
const style = isVertical ?
|
||||
|
|
|
@ -43,7 +43,7 @@ const {
|
|||
} = ReactNative;
|
||||
|
||||
type Props = {
|
||||
children?: React.Element<any>,
|
||||
children?: React.Element<*>,
|
||||
style?: any,
|
||||
textStyle?: any,
|
||||
viewProps?: any,
|
||||
|
|
|
@ -86,7 +86,7 @@ function create(
|
|||
this._bindPosition(nextProps);
|
||||
}
|
||||
|
||||
render(): React.Element<any> {
|
||||
render(): React.Element<*> {
|
||||
this._pointerEvents = this._computePointerEvents();
|
||||
return (
|
||||
<Component
|
||||
|
|
|
@ -152,7 +152,7 @@ class Incremental extends React.Component<DefaultProps, Props, State> {
|
|||
}).done();
|
||||
}
|
||||
|
||||
render(): ?React.Element<any> {
|
||||
render(): ?React.Element<*> {
|
||||
if (this._rendered || // Make sure that once we render once, we stay rendered even if incrementalGroupEnabled gets flipped.
|
||||
!this.context.incrementalGroupEnabled ||
|
||||
this.state.doIncrementalRender) {
|
||||
|
|
|
@ -124,7 +124,7 @@ class IncrementalExample extends React.Component {
|
|||
console.log('onDone:', stats);
|
||||
}, 0);
|
||||
}
|
||||
render(): React.Element<any> {
|
||||
render(): React.Element<*> {
|
||||
return (
|
||||
<IncrementalGroup
|
||||
disabled={false}
|
||||
|
|
|
@ -65,7 +65,7 @@ class IncrementalGroup extends React.Component {
|
|||
};
|
||||
}
|
||||
|
||||
render(): React.Element<any> {
|
||||
render(): React.Element<*> {
|
||||
return (
|
||||
<Incremental
|
||||
onDone={this.props.onDone}
|
||||
|
|
|
@ -65,7 +65,7 @@ class SwipeableListView extends React.Component {
|
|||
props: Props;
|
||||
state: State;
|
||||
|
||||
_listViewRef: ?React.Element<any> = null;
|
||||
_listViewRef: ?React.Element<*> = null;
|
||||
_shouldBounceFirstRowOnMount: boolean = false;
|
||||
|
||||
static getNewDataSource(): Object {
|
||||
|
@ -118,7 +118,7 @@ class SwipeableListView extends React.Component {
|
|||
}
|
||||
}
|
||||
|
||||
render(): React.Element<any> {
|
||||
render(): React.Element<*> {
|
||||
return (
|
||||
<ListView
|
||||
{...this.props}
|
||||
|
@ -163,7 +163,7 @@ class SwipeableListView extends React.Component {
|
|||
}
|
||||
}
|
||||
|
||||
_renderRow = (rowData: Object, sectionID: string, rowID: string): React.Element<any> => {
|
||||
_renderRow = (rowData: Object, sectionID: string, rowID: string): React.Element<*> => {
|
||||
const slideoutView = this.props.renderQuickActions(rowData, sectionID, rowID);
|
||||
|
||||
// If renderRowSlideout is unspecified or returns falsey, don't allow swipe
|
||||
|
|
|
@ -59,7 +59,7 @@ class SwipeableQuickActionButton extends React.Component {
|
|||
textStyle: Text.propTypes.style,
|
||||
};
|
||||
|
||||
render(): ?React.Element<any> {
|
||||
render(): ?React.Element<*> {
|
||||
if (!this.props.imageSource && !this.props.text) {
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@ class SwipeableQuickActions extends React.Component {
|
|||
style: View.propTypes.style,
|
||||
};
|
||||
|
||||
render(): React.Element<any> {
|
||||
render(): React.Element<*> {
|
||||
// $FlowFixMe found when converting React.createClass to ES6
|
||||
const children = this.props.children;
|
||||
let buttons = [];
|
||||
|
|
|
@ -168,7 +168,7 @@ const SwipeableRow = React.createClass({
|
|||
return true;
|
||||
},
|
||||
|
||||
render(): React.Element<any> {
|
||||
render(): React.Element<*> {
|
||||
// The view hidden behind the main view
|
||||
let slideOutView;
|
||||
if (this.state.isSwipeableViewRendered) {
|
||||
|
|
|
@ -90,15 +90,15 @@ type Props = {
|
|||
*/
|
||||
renderRow: (
|
||||
rowData: any, sectionIdx: number, rowIdx: number, rowKey: string
|
||||
) => ?React.Element<any>,
|
||||
) => ?React.Element<*>,
|
||||
/**
|
||||
* Rendered when the list is scrolled faster than rows can be rendered.
|
||||
*/
|
||||
renderWindowBoundaryIndicator?: () => ?React.Element<any>,
|
||||
renderWindowBoundaryIndicator?: () => ?React.Element<*>,
|
||||
/**
|
||||
* Always rendered at the bottom of all the rows.
|
||||
*/
|
||||
renderFooter?: () => ?React.Element<any>,
|
||||
renderFooter?: () => ?React.Element<*>,
|
||||
/**
|
||||
* Pipes through normal onScroll events from the underlying `ScrollView`.
|
||||
*/
|
||||
|
@ -138,7 +138,7 @@ type Props = {
|
|||
* A function that returns the scrollable component in which the list rows
|
||||
* are rendered. Defaults to returning a ScrollView with the given props.
|
||||
*/
|
||||
renderScrollComponent: (props: ?Object) => React.Element<any>,
|
||||
renderScrollComponent: (props: ?Object) => React.Element<*>,
|
||||
/**
|
||||
* Use to disable incremental rendering when not wanted, e.g. to speed up initial render.
|
||||
*/
|
||||
|
@ -431,7 +431,7 @@ class WindowedListView extends React.Component {
|
|||
this._firstVisible = newFirstVisible;
|
||||
this._lastVisible = newLastVisible;
|
||||
}
|
||||
render(): React.Element<any> {
|
||||
render(): React.Element<*> {
|
||||
const {firstRow} = this.state;
|
||||
const lastRow = clamp(0, this.state.lastRow, this.props.data.length - 1);
|
||||
const rowFrames = this._rowFrames;
|
||||
|
@ -586,7 +586,7 @@ type CellProps = {
|
|||
*/
|
||||
renderRow: (
|
||||
rowData: mixed, sectionIdx: number, rowIdx: number, rowKey: string
|
||||
) => ?React.Element<any>,
|
||||
) => ?React.Element<*>,
|
||||
/**
|
||||
* Index of the row, passed through to other callbacks.
|
||||
*/
|
||||
|
|
|
@ -58,7 +58,7 @@ class NetworkOverlay extends React.Component {
|
|||
_listViewHighlighted: bool;
|
||||
_listViewHeight: number;
|
||||
_scrollView: ?ScrollView;
|
||||
_detailViewItems: Array<Array<React.Element<any>>>;
|
||||
_detailViewItems: Array<Array<React.Element<*>>>;
|
||||
_listViewOnLayout: (event: Event) => void;
|
||||
_captureRequestListView: (listRef: ?ListView) => void;
|
||||
_captureDetailScrollView: (scrollRef: ?ScrollView) => void;
|
||||
|
@ -67,8 +67,8 @@ class NetworkOverlay extends React.Component {
|
|||
sectionID: number,
|
||||
rowID: number,
|
||||
highlightRow: (sectionID: number, rowID: number) => void,
|
||||
) => React.Element<any>;
|
||||
_renderScrollComponent: (props: Object) => React.Element<any>;
|
||||
) => React.Element<*>;
|
||||
_renderScrollComponent: (props: Object) => React.Element<*>;
|
||||
_closeButtonClicked: () => void;
|
||||
// Map of `socketId` -> `index in `_requests``.
|
||||
_socketIdMap: Object;
|
||||
|
@ -294,7 +294,7 @@ class NetworkOverlay extends React.Component {
|
|||
sectionID: number,
|
||||
rowID: number,
|
||||
highlightRow: (sectionID: number, rowID: number) => void,
|
||||
): React.Element<any> {
|
||||
): React.Element<*> {
|
||||
let urlCellViewStyle = styles.urlEvenCellView;
|
||||
let methodCellViewStyle = styles.methodEvenCellView;
|
||||
if (rowID % 2 === 1) {
|
||||
|
@ -327,7 +327,7 @@ class NetworkOverlay extends React.Component {
|
|||
_renderSeperator(
|
||||
sectionID: number,
|
||||
rowID: number,
|
||||
adjacentRowHighlighted: bool): React.Element<any> {
|
||||
adjacentRowHighlighted: bool): React.Element<*> {
|
||||
return (
|
||||
<View
|
||||
key={`${sectionID}-${rowID}`}
|
||||
|
@ -367,7 +367,7 @@ class NetworkOverlay extends React.Component {
|
|||
this._listViewHeight = height;
|
||||
}
|
||||
|
||||
_renderScrollComponent(props: Object): React.Element<any> {
|
||||
_renderScrollComponent(props: Object): React.Element<*> {
|
||||
return (
|
||||
<RecyclerViewBackedScrollView {...props} />
|
||||
);
|
||||
|
|
|
@ -129,7 +129,7 @@ class Modal extends React.Component {
|
|||
visible: true,
|
||||
};
|
||||
|
||||
render(): ?React.Element<any> {
|
||||
render(): ?React.Element<*> {
|
||||
if (this.props.visible === false) {
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -175,7 +175,7 @@ class NavigationTransitioner extends React.Component<any, Props, State> {
|
|||
});
|
||||
}
|
||||
|
||||
render(): React.Element<any> {
|
||||
render(): React.Element<*> {
|
||||
return (
|
||||
<View
|
||||
onLayout={this._onLayout}
|
||||
|
|
|
@ -114,7 +114,7 @@ export type NavigationAnimationSetter = (
|
|||
|
||||
export type NavigationSceneRenderer = (
|
||||
props: NavigationSceneRendererProps,
|
||||
) => ?React.Element<any>;
|
||||
) => ?React.Element<*>;
|
||||
|
||||
export type NavigationStyleInterpolator = (
|
||||
props: NavigationSceneRendererProps,
|
||||
|
|
|
@ -44,7 +44,7 @@ const _takeSnapshot = UIManager.takeSnapshot;
|
|||
* @platform ios
|
||||
*/
|
||||
UIManager.takeSnapshot = async function(
|
||||
view ?: 'window' | React.Element<any> | number,
|
||||
view ?: 'window' | React.Element<*> | number,
|
||||
options ?: {
|
||||
width ?: number,
|
||||
height ?: number,
|
||||
|
|
|
@ -221,7 +221,7 @@ const Text = React.createClass({
|
|||
touchableHandlePress: (null: ?Function),
|
||||
touchableHandleLongPress: (null: ?Function),
|
||||
touchableGetPressRectOffset: (null: ?Function),
|
||||
render(): React.Element<any> {
|
||||
render(): React.Element<*> {
|
||||
let newProps = this.props;
|
||||
if (this.props.onStartShouldSetResponder || this._hasPressHandler()) {
|
||||
if (!this._handlers) {
|
||||
|
|
Loading…
Reference in New Issue