Add type parameter for ref objects

All HTML elements are descendants of HTMLElement, but they also may have additional methods. For this to work right, we need the option to specify what exactly the element is expected to be.
This commit is contained in:
Andrew Huth 2019-04-08 14:12:54 -07:00
parent d9f74cb42c
commit f70c679f72

View File

@ -162,7 +162,7 @@ export function range<T extends number>(min?: number, max?: number): PropTypes.R
export function range(min?: number, max?: number): PropTypes.Requireable<number>;
export function ref(): PropTypes.Requireable<ReactLegacyRefLike<HTMLElement>>;
export function ref<T = HTMLElement>(): PropTypes.Requireable<ReactLegacyRefLike<T>>;
export function requiredBy<P>(
requiredByPropName: string,