Skip to content

Instantly share code, notes, and snippets.

View rishabhgrg's full-sized avatar
👨‍💻

Rishabh Garg rishabhgrg

👨‍💻
View GitHub Profile
import PropTypes from 'prop-types';
type Omit<T, K> = Pick<T, Exclude<keyof T, K>>;
type Defined<T> = T extends undefined ? never : T;
/**
* Get the type that represents the props with the defaultProps included.
*
* Alternatively, we could have done something like this: