[change] RefreshControl, StatusBar, YellowBox as function components

This commit is contained in:
Nicolas Gallagher
2020-06-02 10:55:50 -07:00
parent 8d37fde5ee
commit d94a14dc8c
4 changed files with 34 additions and 35 deletions
+2 -1
View File
@@ -53,7 +53,7 @@ const Picker = forwardRef<PickerProps, *>((props, ref) => {
hostRef.current = c;
}
});
usePlatformMethods(hostRef, ref, null, style);
usePlatformMethods(hostRef, ref, [], style);
function handleChange(e: Object) {
const { selectedIndex, value } = e.target;
@@ -74,6 +74,7 @@ const Picker = forwardRef<PickerProps, *>((props, ref) => {
});
});
// $FlowFixMe
Picker.Item = PickerItem;
const styles = StyleSheet.create({
+17 -19
View File
@@ -28,26 +28,24 @@ type RefreshControlProps = {
titleColor?: ColorValue
};
class RefreshControl extends React.Component<RefreshControlProps> {
render() {
const {
/* eslint-disable */
colors,
enabled,
onRefresh,
progressBackgroundColor,
progressViewOffset,
refreshing,
size,
tintColor,
title,
titleColor,
/* eslint-enable */
...rest
} = this.props;
function RefreshControl(props: RefreshControlProps) {
const {
/* eslint-disable */
colors,
enabled,
onRefresh,
progressBackgroundColor,
progressViewOffset,
refreshing,
size,
tintColor,
title,
titleColor,
/* eslint-enable */
...rest
} = props;
return <View {...rest} />;
}
return <View {...rest} />;
}
export default RefreshControl;
+11 -10
View File
@@ -7,15 +7,16 @@
* @flow
*/
import { Component } from 'react';
const emptyFunction = () => {};
export default class StatusBar extends Component<*> {
static setBackgroundColor() {}
static setBarStyle() {}
static setHidden() {}
static setNetworkActivityIndicatorVisible() {}
static setTranslucent() {}
render() {
return null;
}
function StatusBar() {
return null;
}
StatusBar.setBackgroundColor = emptyFunction;
StatusBar.setBarStyle = emptyFunction;
StatusBar.setHidden = emptyFunction;
StatusBar.setNetworkActivityIndicatorVisible = emptyFunction;
StatusBar.setTranslucent = emptyFunction;
export default StatusBar;
+4 -5
View File
@@ -11,11 +11,10 @@
import React from 'react';
import UnimplementedView from '../../modules/UnimplementedView';
class YellowBox extends React.Component<*> {
static ignoreWarnings() {}
render() {
return <UnimplementedView {...this.props} />;
}
function YellowBox(props: Object) {
return <UnimplementedView {...props} />;
}
YellowBox.ignoreWarnings = () => {};
export default YellowBox;