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

PropTypes not removed from 'createClass' in some situations #68

Closed
necolas opened this issue Nov 23, 2016 · 6 comments
Closed

PropTypes not removed from 'createClass' in some situations #68

necolas opened this issue Nov 23, 2016 · 6 comments

Comments

@necolas
Copy link

necolas commented Nov 23, 2016

Looks like propTypes aren't removed from a component created with createClass in some situations. I've only quickly looked into it, but these are examples of code that still contains propTypes (and throws errors in production because the View propTypes don't exist anymore):

import View from 'View';

const ScrollView = React.createClass({
  propTypes: {
    children: View.propTypes.children
  }
});

and

import View from 'View';

const ScrollView = React.createClass({
  propTypes: {
    ...View.propTypes,
    onScroll: PropTypes.func
  }
});
@oliviertassinari
Copy link
Owner

One workaround would be to explicitlty export the View propTypes.
But I don't think that I have enough information to dig into it. Sorry.

@necolas
Copy link
Author

necolas commented Nov 23, 2016

Yes there are workarounds. However, I would expect these propTypes to be removed. What other information do you need?

@oliviertassinari
Copy link
Owner

oliviertassinari commented Nov 23, 2016

What other information do you need?

I would need a reproduction test case.

The propTypes identification logic is right here.
I'm wondering what could mess it.
Could you have a look at the logic checks? That may help.

@oliviertassinari
Copy link
Owner

I'm closing this issue as missing a reproduction test case. If you can find one, please go ahead.
Any help to improve this plugin is welcomed 👍 . Thanks.

@necolas
Copy link
Author

necolas commented Dec 2, 2016

Sorry I haven't gotten around to it yet :/
Perhaps this is something that can be rolled into the react preset if you haven't the time?

@oliviertassinari
Copy link
Owner

Perhaps this is something that can be rolled into the react preset if you haven't the time?

I'm not sure to understand. How is this linked to time? IMHO, it's a matter of information, I don't have enough to have leverage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants