Incorrect props Infer error when used Intersection types as template parameter in React.ComponentType
- Dominant language
- Rust
- Stars
- 22.3k
- Forks
- 1.9k
- PR merge metrics
- No merged PRs in 30d
Description
Flow version: v.0.103.0 or v.0.102.0
[Try flow link](https://flow.org/try/#0PQKgBAAgZgNg9gdzCYAoVBLAtgBzgJwBdkwBDAZzACUBTUgY2KnzizAHJ87H2BudGgA88RMIQCeOGmCgZ85YgF4wAb1RgwAaxriAjAC4wC-BgB2AcwA0qAL79UQkcQlSjNenFMATMMrUbtcQAmQ2MzK1t7RwJnSWkAIzhCAAtfGTkFMAAyNw9vflAwVABIGgA3GnxxFPCwDEo4TTAEDBS4AFdiM0JK8ndCDE8AOgdhGLE4sESUtLViwIMwi2t5nRCliLtUFAEx0RdpD1xPGlMlam5CIYBhVjxTU8IAFTiAHmnUnJUk5MqAaR0hlIpnENgAfPYoO1TIxBqYwOYaIRbscHmcABQASkMR3uj1U6jAXEI7Xw8JwLBwlEUYLAry8GDKYJUFLgVKGP3+Ohsr2ADKZ-BsqDymRRODSiORdxOGMxUT2xC8NCgpHaMGIWN8YPRrzFWh0ukUACJdEb9cFjUEzZz8ADxMbTcAwXKgA)
## Actual behavior
```javascript
/* @flow */
import * as React from 'react';
export type first = {
key1: string,
};
export type second = {
key2: string,
};
export type both = first & second;
/*
everything is ok without intersection.
export type both = {
key1:string,
key2:string,
};
*/
export type component = React.ComponentType;
function getComponent(): component {
return props =>
}
const Comp = getComponent();
export default () =>();
```
```
25: return props =>
^ Cannot get `props.otherKey` because property `otherKey` is missing in props [1].
References:
22: export type component = React.ComponentType;
^ [1]
```
## Expected behavior
No error when intersection type used.
Contributor guide
Assessment
This issue has not been assessed yet.