mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-03 14:27:04 +00:00
feat(react): exclude number from keyof JSX.IntrinsicElements (#42282)
It's required to exclude `number` type from `keyof JSX.IntrinsicElements` because of the case when `JSX.IntrinsicElements` has some additional declarations with indexer type, for example
```
declare namespace JSX {
interface IntrinsicElements extends JSX.IntrinsicElements {
[name: string]: SomeJSXElementType;
}
}
```
This commit is contained in:
Vendored
+1
-1
@@ -116,7 +116,7 @@ declare namespace React {
|
||||
interface ReactComponentElement<
|
||||
T extends keyof JSX.IntrinsicElements | JSXElementConstructor<any>,
|
||||
P = Pick<ComponentProps<T>, Exclude<keyof ComponentProps<T>, 'key' | 'ref'>>
|
||||
> extends ReactElement<P, T> { }
|
||||
> extends ReactElement<P, Exclude<T, number>> { }
|
||||
|
||||
/**
|
||||
* @deprecated Please use `FunctionComponentElement`
|
||||
|
||||
Reference in New Issue
Block a user