mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-29 18:06:01 +08:00
[react] Add T param to React.DOM* types
This commit is contained in:
@@ -19,7 +19,7 @@ var clickHandler: React.MouseEventHandler
|
||||
|
||||
// Tests with spec string
|
||||
function spec_string () {
|
||||
var result: React.ReactHTMLElement
|
||||
var result: React.ReactHTMLElement<HTMLElement>
|
||||
|
||||
// just spec string
|
||||
result = $('div')
|
||||
|
||||
4
jsnox/jsnox.d.ts
vendored
4
jsnox/jsnox.d.ts
vendored
@@ -31,7 +31,7 @@ declare module 'jsnox' {
|
||||
* @param children A single React node (string or ReactElement) or array of nodes.
|
||||
* Note that unlike with React itself, multiple children must be placed into an array.
|
||||
*/
|
||||
<P>(specString: string, children: React.ReactNode): React.DOMElement<P>
|
||||
<P>(specString: string, children: React.ReactNode): React.DOMElement<P, Element>
|
||||
|
||||
/**
|
||||
* Renders an HTML element from the given spec string, with optional props
|
||||
@@ -42,7 +42,7 @@ declare module 'jsnox' {
|
||||
* @param children A single React node (string or ReactElement) or array of nodes.
|
||||
* Note that unlike with React itself, multiple children must be placed into an array.
|
||||
*/
|
||||
<P>(specString: string, props?: React.HTMLAttributes, children?: React.ReactNode): React.DOMElement<P>
|
||||
<P>(specString: string, props?: React.HTMLAttributes, children?: React.ReactNode): React.DOMElement<P, Element>
|
||||
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user