File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -273,16 +273,14 @@ The advantage of extracting the prop types is that you won't need to export ever
273
273
// helper type for all known valid JSX element constructors (class and function based)
274
274
type ElementConstructor <P > =
275
275
| ((props : P ) => React .ReactElement <any > | null )
276
- | (new (props : P ) => React .Component <P , any , any >
276
+ | (new (props : P ) => React .Component <P , any , any >);
277
277
278
278
// gets the internal props of a component
279
279
// used like Props<typeof MyComponent>
280
280
// or Props<'button'> for intrinsic HTML attributes
281
281
type Props <C > = C extends ElementConstructor <infer P >
282
282
? P
283
- : C extends keyof JSX .IntrinsicElements
284
- ? JSX .InstrinsicElements [C ]
285
- : {}
283
+ : C extends keyof JSX .IntrinsicElements ? JSX .IntrinsicElements [C ] : {};
286
284
287
285
// goes one step further and resolves with propTypes and defaultProps properties
288
286
type ApparentProps <C > = C extends ElementConstructor <infer P > ? JSX .LibraryManagedAttributes <C , P > : Props <C >
You can’t perform that action at this time.
0 commit comments