Skip to content

Instantly share code, notes, and snippets.

View tkryskiewicz's full-sized avatar

Tomasz Kryśkiewicz tkryskiewicz

  • Wrocław, Poland
View GitHub Profile
@itsdouges
itsdouges / hoc-wrapping-component-with-default-props.tsx
Last active January 27, 2020 19:49
Passing default props info through a HOC using TypeScript 3.1.x
import * as React from 'react';
type Omit<T, K extends keyof any> = T extends any ? Pick<T, Exclude<keyof T, K>> : never;
type ExtractProps<TComponentOrTProps> = TComponentOrTProps extends React.ComponentType<
infer P
>
? P
: never;
interface InjectedProps {