mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-30 23:30:06 +00:00
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:
2
types/airbnb-prop-types/index.d.ts
vendored
2
types/airbnb-prop-types/index.d.ts
vendored
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user