mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-22 20:39:17 +08:00
add convenience overload to getDOMNode
This commit is contained in:
5
react/react.d.ts
vendored
5
react/react.d.ts
vendored
@@ -117,6 +117,11 @@ declare module React {
|
||||
|
||||
export interface DomReferencer {
|
||||
getDOMNode(): Element;
|
||||
/**
|
||||
* Use this overload to cast the returned element to a more specific type.
|
||||
* Eg: var name = this.refs['name'].getDOMNode<HTMLInputElement>().value
|
||||
*/
|
||||
getDOMNode<TElement extends Element>(): TElement;
|
||||
}
|
||||
|
||||
export interface Component<P, S> extends DomReferencer {
|
||||
|
||||
Reference in New Issue
Block a user