mirror of
https://github.com/zoriya/react-native-web.git
synced 2026-08-15 18:45:06 +00:00
[change] RefreshControl, StatusBar, YellowBox as function components
This commit is contained in:
+2
-1
@@ -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
@@ -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
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user