Skip to content

Commit 3708019

Browse files
authored
Reduce complexity of FullProps type
1 parent 31cca29 commit 3708019

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

src/types.ts

+1-8
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,7 @@ interface PureFunctionComponent<P = {}> {
99
export type SetupComponentType = React.ComponentType<any> | PureFunctionComponent;
1010

1111
// Given a C component type, extracts the props of it:
12-
// * If C is an explicitly declared React.Component subclass or React.FC, we can use React.ComponentProps
13-
// * Otherewise if it's a regular function, we can extract its first parameter as the props
14-
// * If not, we give up...
15-
export type FullProps<C extends SetupComponentType> = C extends React.ComponentType
16-
? React.ComponentProps<C>
17-
: C extends PureFunctionComponent
18-
? Parameters<C>[0]
19-
: unknown;
12+
export type FullProps<C extends SetupComponentType> = React.ComponentProps<C>
2013

2114
export type RenderEnzyme<
2215
Component extends SetupComponentType,

0 commit comments

Comments
 (0)