6
6
* Copyright 2015, Yahoo! Inc.
7
7
* Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
8
8
*/
9
- import type * as React from 'react'
9
+ import type {
10
+ ComponentType ,
11
+ ForwardRefExoticComponent ,
12
+ MemoExoticComponent ,
13
+ } from 'react'
10
14
import { ForwardRef , Memo , isMemo } from '../utils/react-is'
11
15
12
16
const REACT_STATICS = {
@@ -66,16 +70,16 @@ function getStatics(component: any) {
66
70
}
67
71
68
72
export type NonReactStatics <
69
- S extends React . ComponentType < any > ,
73
+ S extends ComponentType < any > ,
70
74
C extends {
71
75
[ key : string ] : true
72
76
} = { } ,
73
77
> = {
74
78
[ key in Exclude <
75
79
keyof S ,
76
- S extends React . MemoExoticComponent < any >
80
+ S extends MemoExoticComponent < any >
77
81
? keyof typeof MEMO_STATICS | keyof C
78
- : S extends React . ForwardRefExoticComponent < any >
82
+ : S extends ForwardRefExoticComponent < any >
79
83
? keyof typeof FORWARD_REF_STATICS | keyof C
80
84
: keyof typeof REACT_STATICS | keyof typeof KNOWN_STATICS | keyof C
81
85
> ] : S [ key ]
@@ -89,8 +93,8 @@ const getPrototypeOf = Object.getPrototypeOf
89
93
const objectPrototype = Object . prototype
90
94
91
95
export default function hoistNonReactStatics <
92
- T extends React . ComponentType < any > ,
93
- S extends React . ComponentType < any > ,
96
+ T extends ComponentType < any > ,
97
+ S extends ComponentType < any > ,
94
98
C extends {
95
99
[ key : string ] : true
96
100
} = { } ,
0 commit comments