UNPKG

514 BTypeScriptView Raw
1import * as React from 'react';
2/**
3 * @desc Utility type for getting props type of React component.
4 * It takes `defaultProps` into an account - making props with defaults optional.
5 */
6export type PropsOf<C extends keyof JSX.IntrinsicElements | React.JSXElementConstructor<any>> = JSX.LibraryManagedAttributes<C, React.ComponentProps<C>>;
7// We need to use this version of Omit as it's distributive (Will preserve unions)
8export type DistributiveOmit<T, U> = T extends any ? Pick<T, Exclude<keyof T, U>> : never;
\No newline at end of file