brigand / brigand/babel-plugin-flow-react-proptypes
Identifier 'PropTypes' has already been declared
- Dominant language
- JavaScript
- Stars
- 427
- Forks
- 42
- PR merge metrics
- No merged PRs in 30d
Description
We use contextTypes so we have to import PropTypes:
```
ScreenHomepage.contextTypes = {
locale: PropTypes.string,
colors: PropTypes.object,
};
```
However, when using the plugin the build fails with:
> ./layout_modules/screen-homepage/ScreenHomepage.js 422:7
> Module parse failed: Identifier 'PropTypes' has already been declared (422:7)
> You may need an appropriate loader to handle this file type.
> | };
> | export default ScreenHomepage;
> > import PropTypes from "prop-types";
This is probably due to the fact the plugin auto adds the PropTypes import.
Is there an option to tell the plugin not to import PropTypes if the import exists?
Contributor guide
Assessment
This issue has not been assessed yet.