Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions packages/jest-preset/jest/RefreshControlMock.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@

'use strict';

import type {RefreshControlProps} from 'react-native/Libraries/Components/RefreshControl/RefreshControl';
import type {HostComponent} from 'react-native/src/private/types/HostComponent';

import * as React from 'react';
import requireNativeComponent from 'react-native/Libraries/ReactNative/requireNativeComponent';

const RCTRefreshControl: HostComponent<{}> = requireNativeComponent<{}>(
'RCTRefreshControl',
);
const RCTRefreshControl: HostComponent<RefreshControlProps> =
requireNativeComponent<RefreshControlProps>('RCTRefreshControl');

export default class RefreshControlMock extends React.Component<{...}> {
export default class RefreshControlMock extends React.Component<RefreshControlProps> {
static latestRef: ?RefreshControlMock;

render(): React.Node {
return <RCTRefreshControl />;
return <RCTRefreshControl {...this.props} />;
}

componentDidMount() {
Expand Down
7 changes: 3 additions & 4 deletions packages/jest-preset/jest/mocks/RefreshControl.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,14 @@ import type {HostComponent} from 'react-native/src/private/types/HostComponent';
import * as React from 'react';
import requireNativeComponent from 'react-native/Libraries/ReactNative/requireNativeComponent';

const RCTRefreshControl: HostComponent<{}> = requireNativeComponent<{}>(
'RCTRefreshControl',
);
const RCTRefreshControl: HostComponent<RefreshControlProps> =
requireNativeComponent<RefreshControlProps>('RCTRefreshControl');

export default class RefreshControlMock extends React.Component<RefreshControlProps> {
static latestRef: ?RefreshControlMock;

render(): React.Node {
return <RCTRefreshControl />;
return <RCTRefreshControl {...this.props} />;
}

componentDidMount() {
Expand Down