mirror of
https://github.com/status-im/react-native.git
synced 2025-02-25 15:45:32 +00:00
Summary: Related to #22100 Turn Flow strict mode on for ScrollViewMock. This file used to declare jest var as `any` but jest module is already typed in root flow folder. Note: I had to use a quick fix for polyfillPromise. See here #22101 - All flow tests succeed. [GENERAL] [ENHANCEMENT] [ScrollViewMock.js] - Flow strict mode Pull Request resolved: https://github.com/facebook/react-native/pull/22103 Differential Revision: D12918380 Pulled By: TheSavior fbshipit-source-id: cd3aba47b1a43e76a7da09e15cc2d9cfcdf7f56d
36 lines
789 B
JavaScript
36 lines
789 B
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
|
|
*/
|
|
|
|
/* eslint-env jest */
|
|
|
|
'use strict';
|
|
|
|
const React = require('React');
|
|
const View = require('View');
|
|
|
|
const requireNativeComponent = require('requireNativeComponent');
|
|
|
|
const RCTScrollView = requireNativeComponent('RCTScrollView');
|
|
|
|
const ScrollViewComponent = jest.genMockFromModule('ScrollView');
|
|
|
|
class ScrollViewMock extends ScrollViewComponent {
|
|
render() {
|
|
return (
|
|
<RCTScrollView {...this.props}>
|
|
{this.props.refreshControl}
|
|
<View>{this.props.children}</View>
|
|
</RCTScrollView>
|
|
);
|
|
}
|
|
}
|
|
|
|
module.exports = ScrollViewMock;
|