mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-12-04 12:11:47 +00:00
Merge pull request #17581 from DefinitelyTyped/improve-react-domelement-type-parameter
Improve React.DOMElement type parameter for 2.4 weak type checks
This commit is contained in:
Vendored
+1
-1
@@ -70,7 +70,7 @@ declare namespace React {
|
||||
type ClassicElement<P> = CElement<P, ClassicComponent<P, ComponentState>>;
|
||||
|
||||
// string fallback for custom web-components
|
||||
interface DOMElement<P extends DOMAttributes<T>, T extends Element> extends ReactElement<P> {
|
||||
interface DOMElement<P extends HTMLAttributes<T> | SVGAttributes<T>, T extends Element> extends ReactElement<P> {
|
||||
type: string;
|
||||
ref: Ref<T>;
|
||||
}
|
||||
|
||||
@@ -721,3 +721,13 @@ const formEvent: InputFormEvent = changeEvent;
|
||||
}
|
||||
const VariableWithAClass: React.ComponentClass<ComponentProps> = ComponentWithDefaultProps;
|
||||
}
|
||||
|
||||
// complex React.DOMElement type
|
||||
declare var x: React.DOMElement<{
|
||||
className: string;
|
||||
style: {
|
||||
height: string;
|
||||
overflowY: "auto";
|
||||
transition: string;
|
||||
};
|
||||
}, Element>;
|
||||
|
||||
Reference in New Issue
Block a user