Skip to content

Commit 1bc63e0

Browse files
authored
Merge pull request #67 from eps1lon/patch-1
Fix formatting, syntax, typos in Props helper
2 parents 880f69a + 3928b4a commit 1bc63e0

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

ADVANCED.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -273,16 +273,14 @@ The advantage of extracting the prop types is that you won't need to export ever
273273
// helper type for all known valid JSX element constructors (class and function based)
274274
type ElementConstructor<P> =
275275
| ((props: P) => React.ReactElement<any> | null)
276-
| (new (props: P) => React.Component<P, any, any>
276+
| (new (props: P) => React.Component<P, any, any>);
277277

278278
// gets the internal props of a component
279279
// used like Props<typeof MyComponent>
280280
// or Props<'button'> for intrinsic HTML attributes
281281
type Props<C> = C extends ElementConstructor<infer P>
282282
? P
283-
: C extends keyof JSX.IntrinsicElements
284-
? JSX.InstrinsicElements[C]
285-
: {}
283+
: C extends keyof JSX.IntrinsicElements ? JSX.IntrinsicElements[C] : {};
286284

287285
// goes one step further and resolves with propTypes and defaultProps properties
288286
type ApparentProps<C> = C extends ElementConstructor<infer P> ? JSX.LibraryManagedAttributes<C, P> : Props<C>

0 commit comments

Comments
 (0)