mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
9f8305a837
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
61 lines
1.4 KiB
JavaScript
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);
|