Skip to content

Error when component is declared before instantiated #58

Closed
@abejfehr

Description

@abejfehr

Our components are written in CJSX, which is compiled to CoffeeScript and then straight to JS. When running react-docgen on the resultant files, I receive the ERROR_MISSING_DEFINITION error. I realize now that this because somewhere during the conversion process, my JS ends up looking like this:

var Component, React;

React = require('react');


/**
 * The is a component to test the document generation
 */

Component = React.createClass({
  displayName: 'Component',
  propTypes: {

...

Since Component = React.createClass({ isn't preceded by var, this documentation generator refuses to see the definition. This is really annoying.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions