mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
16ea9ba813
Summary: Currently the schema only allows to exclude a single platform (iOS OR Android). There are cases where we need to exclude multiple. This change converts the previous `excludePlatform` string property into an `excludePlatforms` array. Changelog: [Internal][Changed] - Added support to exclude multiple platforms in Codegen. Reviewed By: sammy-SC Differential Revision: D21426950 fbshipit-source-id: eff36ffa207109274794b4b300bf6313f8286161
66 lines
1.7 KiB
JavaScript
66 lines
1.7 KiB
JavaScript
/**
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*
|
|
* @format
|
|
* @flow strict-local
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
import type {DirectEventHandler, WithDefault} from '../../Types/CodegenTypes';
|
|
import type {ColorValue} from '../../StyleSheet/StyleSheet';
|
|
import type {ViewProps} from '../View/ViewPropTypes';
|
|
import * as React from 'react';
|
|
|
|
import codegenNativeComponent from '../../Utilities/codegenNativeComponent';
|
|
import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes';
|
|
import codegenNativeCommands from 'react-native/Libraries/Utilities/codegenNativeCommands';
|
|
|
|
type NativeProps = $ReadOnly<{|
|
|
...ViewProps,
|
|
|
|
/**
|
|
* The color of the refresh indicator.
|
|
*/
|
|
tintColor?: ?ColorValue,
|
|
/**
|
|
* Title color.
|
|
*/
|
|
titleColor?: ?ColorValue,
|
|
/**
|
|
* The title displayed under the refresh indicator.
|
|
*/
|
|
title?: WithDefault<string, null>,
|
|
|
|
/**
|
|
* Called when the view starts refreshing.
|
|
*/
|
|
onRefresh?: ?DirectEventHandler<null>,
|
|
|
|
/**
|
|
* Whether the view should be indicating an active refresh.
|
|
*/
|
|
refreshing: boolean,
|
|
|}>;
|
|
|
|
type ComponentType = HostComponent<NativeProps>;
|
|
|
|
interface NativeCommands {
|
|
+setNativeRefreshing: (
|
|
viewRef: React.ElementRef<ComponentType>,
|
|
refreshing: boolean,
|
|
) => void;
|
|
}
|
|
|
|
export const Commands: NativeCommands = codegenNativeCommands<NativeCommands>({
|
|
supportedCommands: ['setNativeRefreshing'],
|
|
});
|
|
|
|
export default (codegenNativeComponent<NativeProps>('PullToRefreshView', {
|
|
paperComponentName: 'RCTRefreshControl',
|
|
excludedPlatforms: ['android'],
|
|
}): HostComponent<NativeProps>);
|