Files
react-native/Libraries/Components/RefreshControl/PullToRefreshViewNativeComponent.js
T
Rick Hanlon 9f8305a837 Add view config for PullToRefresh
Summary:
Adds the generated view config for PullToRefresh

Note: we're not using this view config yet, the component is in the process of being renamed (see TODO)

Reviewed By: rubennorte

Differential Revision: D15485870

fbshipit-source-id: a163ac371181dcc990093e3cd995d7dd9058b26a
2019-05-24 09:21:28 -07:00

61 lines
1.4 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
*/
'use strict';
import type {
BubblingEvent,
WithDefault,
CodegenNativeComponent,
} from '../../Types/CodegenTypes';
const requireNativeComponent = require('../../ReactNative/requireNativeComponent');
import type {ColorValue} from '../../StyleSheet/StyleSheetTypes';
import type {ViewProps} from '../View/ViewPropTypes';
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, ''>,
/**
* Called when the view starts refreshing.
*/
onRefresh?: ?(event: BubblingEvent<null>) => mixed,
/**
* Whether the view should be indicating an active refresh.
*/
refreshing: WithDefault<boolean, false>,
|}>;
type PullToRefreshViewType = CodegenNativeComponent<
'PullToRefreshView',
NativeProps,
>;
// TODO: Switch this over to require('./PullToRefreshNativeViewConfig')
// once the native components are renamed in paper and fabric
module.exports = ((requireNativeComponent(
'RCTRefreshControl',
): any): PullToRefreshViewType);