@@ -6,7 +6,7 @@ import ReactDOM from 'react-dom';
6
6
import elementTypeAcceptingRef from './elementTypeAcceptingRef' ;
7
7
8
8
describe ( 'elementTypeAcceptingRef' , ( ) => {
9
- function checkPropType ( elementType ) {
9
+ function checkPropType ( elementType : any ) {
10
10
PropTypes . checkPropTypes (
11
11
{ component : elementTypeAcceptingRef } ,
12
12
{ component : elementType } ,
@@ -20,11 +20,9 @@ describe('elementTypeAcceptingRef', () => {
20
20
} ) ;
21
21
22
22
describe ( 'acceptance' , ( ) => {
23
- let rootNode ;
24
-
25
- function assertPass ( Component , options = { } ) {
26
- const { failsOnMount = false , shouldMount = true } = options ;
23
+ let rootNode : HTMLElement ;
27
24
25
+ function assertPass ( Component : any , { failsOnMount = false , shouldMount = true } = { } ) {
28
26
function testAct ( ) {
29
27
checkPropType ( Component ) ;
30
28
if ( shouldMount ) {
@@ -88,14 +86,14 @@ describe('elementTypeAcceptingRef', () => {
88
86
} ) ;
89
87
90
88
it ( 'accepts memo' , ( ) => {
91
- const Component = React . memo ( 'div' ) ;
89
+ const Component = React . memo ( React . forwardRef ( ( ) => null ) ) ;
92
90
93
91
assertPass ( Component ) ;
94
92
} ) ;
95
93
96
94
it ( 'accepts lazy' , ( ) => {
97
95
const Component = React . lazy ( ( ) =>
98
- Promise . resolve ( { default : ( props ) => < div { ...props } /> } ) ,
96
+ Promise . resolve ( { default : ( props : any ) => < div { ...props } /> } ) ,
99
97
) ;
100
98
101
99
// should actually fail when mounting since the ref is forwarded to a function component
@@ -114,7 +112,7 @@ describe('elementTypeAcceptingRef', () => {
114
112
} ) ;
115
113
116
114
describe ( 'rejections' , ( ) => {
117
- function assertFail ( Component , hint ) {
115
+ function assertFail ( Component : any , hint : string ) {
118
116
expect ( ( ) => {
119
117
checkPropType ( Component ) ;
120
118
} ) . toErrorDev (
0 commit comments