mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Summary: Adds `flow` (or `noflow`) to all files in this directory and ensures that Flow succeeds (by adding type annotations, using minor refactors, or suppressing errors due to intentionally dynamic logic). This will help improve type safety when making changes both in these files as well as files that these depend on. Changelog: [Internal] Pull Request resolved: https://github.com/facebook/react-native/pull/51652 Test Plan: Ran Flow and Jest tests successfully: ``` $ yarn flow $ yarn test ``` Ran a Jest unit test internally to make sure they work with our internal environment setup: ``` $ cd ~/fbsource $ js1 test /View-test.js ``` Reviewed By: javache Differential Revision: D75488160 Pulled By: yungsters fbshipit-source-id: 536cef9699acfa1edcd3dcf61c53ebcd92f560f9
33 lines
784 B
JavaScript
33 lines
784 B
JavaScript
/**
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*
|
|
* @flow strict-local
|
|
* @format
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
import type {HostComponent} from '../src/private/types/HostComponent';
|
|
|
|
import requireNativeComponent from '../Libraries/ReactNative/requireNativeComponent';
|
|
import * as React from 'react';
|
|
|
|
const RCTRefreshControl: HostComponent<{}> = requireNativeComponent<{}>(
|
|
'RCTRefreshControl',
|
|
);
|
|
|
|
export default class RefreshControlMock extends React.Component<{...}> {
|
|
static latestRef: ?RefreshControlMock;
|
|
|
|
render(): React.Node {
|
|
return <RCTRefreshControl />;
|
|
}
|
|
|
|
componentDidMount() {
|
|
RefreshControlMock.latestRef = this;
|
|
}
|
|
}
|