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

0.53 changes and weak mode for React.Component

Open
#128 6 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-upgrade` effectively turned weak components into

```javascript
class Foo extends React.Component<$FlowFixMeProps, $FlowFixMeState>
```

This causes this plugin to fail with:

```
Did not find type annotation for UnmountTransition
at annotate (/Users/kross/projects/material-ui/node_modules/babel-plugin-flow-react-proptypes/lib/index.js:89:13)
at PluginPass.ClassDeclaration (/Users/kross/projects/material-ui/node_modules/babel-plugin-flow-react-proptypes/lib/index.js:202:18)
at newFn (/Users/kross/projects/material-ui/node_modules/babel-traverse/lib/visitors.js:276:21)
at NodePath._call (/Users/kross/projects/material-ui/node_modules/babel-traverse/lib/path/context.js:76:18)
at NodePath.call (/Users/kross/projects/material-ui/node_modules/babel-traverse/lib/path/context.js:48:17)
at NodePath.visit (/Users/kross/projects/material-ui/node_modules/babel-traverse/lib/path/context.js:105:12)
at TraversalContext.visitQueue (/Users/kross/projects/material-ui/node_modules/babel-traverse/lib/context.js:150:16)
at TraversalContext.visitMultiple (/Users/kross/projects/material-ui/node_modules/babel-traverse/lib/context.js:103:17)
at TraversalContext.visit (/Users/kross/projects/material-ui/node_modules/babel-traverse/lib/context.js:190:19)
at Function.traverse.node (/Users/kross/projects/material-ui/node_modules/babel-traverse/lib/index.js:114:17)
```

I'm not sure what to do, but we need to ignore suppressed annotated types. Removing the `<$FlowFixMeProps, $FlowFixMeState>` leads to a slew of other errors requiring `$FlowFixMe suppressions`.

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.