mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 14:20:12 +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:
2
types/react/index.d.ts
vendored
2
types/react/index.d.ts
vendored
@@ -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