Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ES5 and closures ... #38

Closed
rohan-deshpande opened this issue Nov 24, 2015 · 2 comments
Closed

ES5 and closures ... #38

rohan-deshpande opened this issue Nov 24, 2015 · 2 comments
Labels

Comments

@rohan-deshpande
Copy link

Hi I'm wondering if it's still possible to use react-docgen when code is in the following format

 (function (app) {
    'use strict';
    /**
     * MyComponent description
     */
    app.components.MyComponent = React.createClass({
        //stuff;
    });
 }(app));

If so, how would I get it to work? I'm currently getting the following error Error: No suitable component definition found.

Edit hmm well seems like I need to var React = require('react'); at the top of the component which makes sense since react-docgen doesn't know about me including it via gulp, but yeah I think maybe this syntax won't work.

@fkling
Copy link
Member

fkling commented Dec 7, 2015

Sorry for the late reply. In this case you have to pass the findAllComponentDefinitions resolver to reactDocgen.parse or write your own.

I should make this a command line option really.

@fkling fkling added the question label Jan 4, 2016
@fkling
Copy link
Member

fkling commented Jan 4, 2016

I'm closing this for now since I do see any actionable item here. If you think there is something to do here, please reopen.

@fkling fkling closed this as completed Jan 4, 2016
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants