Skip to content

Identifier 'PropTypes' has already been declared #209

@dht

Description

@dht

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions