React.createElement is unsound with inexact configs
- Dominant language
- Rust
- Stars
- 22.3k
- Forks
- 1.9k
- PR merge metrics
- No merged PRs in 30d
Description
Flow version: -
## Expected behavior
```
class Component extends React.Component<{foo: number, bar: number}> {
static defaultProps = {foo: 3}
}
declare var config: {bar: number};
React.createElement(Component, config); // Should error, config might contain foo with a non-number type
```
## Actual behavior
The above code sample passes
* [Link to Try-Flow or Github repo](https://flow.org/try/#0MYewdgzgLgBASgUwIbFgXhgJwQRwK4CW2AFAOTYpSkCUA3AFD3AA2SEEMAwiALYAO4BGFgIAHlCEATDokoA6bv0HCAPAG8AZiBAAuGGDw8ARgkwAaGEaSY9B46YC+APhhr6MGNCRQCwGJIQNJDxmKAAFTBA+DgxNbT0AZgd6ZPoAlmsEGAA3axhQMA0CAHM9NSsbfUMTTAcGWVQ5YAoJAFFmBB4hKGJFATBuiwKi4roPAHpxmABlAAsQEMkYU0jzfPARmB4S2dgCqCQCMBgtEBgAdwIoWZgkfXAAWjsamCgATz4EIA)
Contributor guide
Assessment
This issue has not been assessed yet.