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

Does not work in my case if I use the babel configuration in webpack #56

Open
s-kobets opened this issue Jun 24, 2018 · 2 comments
Open
Labels

Comments

@s-kobets
Copy link

s-kobets commented Jun 24, 2018

Use webpack.config

use: {
          loader: 'babel-loader',
          options: {
            presets: ['env', 'react'],
            plugins: [
              'transform-class-properties',
              'react-docgen'
            ]
          }
        }
class Doc extends PureComponent {
  static defaultProps = {
    name: 'stranger'
  };

  static propTypes = {
    name: PropTypes.string
  };
  render() {
    return <div>123</div>;
  }
}

return Doc.__docgenInfo = undefined

@s-kobets
Copy link
Author

I am sorry, win.
If import Doc in file index.js then working
if use console.log(Doc.__docgenInfo) in file when create class Doc - not work

@danielduan
Copy link
Member

I wonder if docgen detects PureComponent as a valid class type. Let me investigate this when I have time, or please feel free to open a PR if you'd like to try and solve this as well.

@wuweiweiwu wuweiweiwu added the bug label Jul 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants