Skip to content

Error thrown on constants import #150

Closed
@avaly

Description

@avaly

The following file is throwing an error on parse:

import React, { Component, PropTypes } from 'react';
import { SMALL, LARGE } from './sizes';

class Test extends Component {
  render() {
    return <div />;
  }
}

Test.propTypes = {
  size: PropTypes.oneOf([SMALL, LARGE]),
};

export default Test;

Output:

Error with path "bug-import.js": Error: [{type: ImportSpecifier, start: 62, end: 67, loc: [object Object], imported: [object Object], local: [object Object], id: null, name: null}, {type: ImportSpecifier, start: 69, end: 74, loc: [object Object], imported: [object Object], local: [object Object], id: null, name: null}] does not match type Printable

If the second import line is commented out, it doesn't throw an error on parse, but the values for the constants are set to their names as string.

Using react-docgen v2.13.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions