brigand / brigand/babel-plugin-flow-react-proptypes

Support `React.ElementProps`

Open
#147 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
427
Forks
42
PR merge metrics
No merged PRs in 30d

Description

Flow provides a method for obtaining a component's prop types called `React.ElementProps` ([documentation here](https://flow.org/en/docs/react/types/#toc-react-elementprops)).

`babel-plugin-flow-react-proptypes` does not recognize usage, resulting in a transpilation error along these lines:

```
ERROR in
Module build failed: TypeError: : Cannot read property 'forEach' of undefined
at convertToPropTypes (/node_modules/babel-plugin-flow-react-proptypes/lib/convertToPropTypes.js:77:19)
at /node_modules/babel-plugin-flow-react-proptypes/lib/convertToPropTypes.js:31:20
at Array.forEach ()
at convertToPropTypes (/node_modules/babel-plugin-flow-react-proptypes/lib/convertToPropTypes.js:27:21)
at convertToPropTypes (/node_modules/babel-plugin-flow-react-proptypes/lib/convertToPropTypes.js:51:13)
at /node_modules/babel-plugin-flow-react-proptypes/lib/convertToPropTypes.js:31:20
at Array.forEach ()
at convertToPropTypes (/node_modules/babel-plugin-flow-react-proptypes/lib/convertToPropTypes.js:27:21)
at convertNodeToPropTypes (/node_modules/babel-plugin-flow-react-proptypes/lib/index.js:31:43)
at PluginPass.TypeAlias (/node_modules/babel-plugin-flow-react-proptypes/lib/index.js:175:25)
```

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.