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:
Artur Kenzhaev
2020-02-27 21:22:22 +03:00
committed by GitHub
parent e7e259f3fe
commit 2034c45ba9

View File

@@ -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`