Skip to content

Commit 86779ff

Browse files
aryaemami59markerikson
authored andcommitted
Fix duplicate React import in hoistStatics.ts
1 parent 7d48677 commit 86779ff

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/utils/hoistStatics.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@
66
* Copyright 2015, Yahoo! Inc.
77
* Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
88
*/
9-
import type * as React from 'react'
9+
import type {
10+
ComponentType,
11+
ForwardRefExoticComponent,
12+
MemoExoticComponent,
13+
} from 'react'
1014
import { ForwardRef, Memo, isMemo } from '../utils/react-is'
1115

1216
const REACT_STATICS = {
@@ -66,16 +70,16 @@ function getStatics(component: any) {
6670
}
6771

6872
export type NonReactStatics<
69-
S extends React.ComponentType<any>,
73+
S extends ComponentType<any>,
7074
C extends {
7175
[key: string]: true
7276
} = {},
7377
> = {
7478
[key in Exclude<
7579
keyof S,
76-
S extends React.MemoExoticComponent<any>
80+
S extends MemoExoticComponent<any>
7781
? keyof typeof MEMO_STATICS | keyof C
78-
: S extends React.ForwardRefExoticComponent<any>
82+
: S extends ForwardRefExoticComponent<any>
7983
? keyof typeof FORWARD_REF_STATICS | keyof C
8084
: keyof typeof REACT_STATICS | keyof typeof KNOWN_STATICS | keyof C
8185
>]: S[key]
@@ -89,8 +93,8 @@ const getPrototypeOf = Object.getPrototypeOf
8993
const objectPrototype = Object.prototype
9094

9195
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>,
9498
C extends {
9599
[key: string]: true
96100
} = {},

0 commit comments

Comments
 (0)