facebook / facebook/flow

Export a generic list of html elements

Open
#8,173 0 comments 1 reaction 0 assignees View on GitHub
discussion
Dominant language
Rust
Stars
22.3k
Forks
1.9k
PR merge metrics
No merged PRs in 30d

Description

## Proposal
Export a generic HTMLIntrinsics type, in addition to JSXIntrinsics.
[Line 271](https://github.com/facebook/flow/blob/v0.104.0/lib/react-dom.js#L271) removes the ability to verify a string is a valid html element

## Use case
For example:
```
const generateComponent = (ComponentString: $Keys<$JSXIntrinsics>, styleObject) => {
return
}

const ValidComponent = generateComponent('div'); // Works
const ShouldThrowErrorComponent = generateComponent('divv'); // Works! but it should fail
```

Without disrupting the existing behavior of JSXIntrinsics, we could add HTMLIntrinsics.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.