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

add classWithRenderNotExtended warning #11149

Closed
wants to merge 2 commits into from
Closed

add classWithRenderNotExtended warning #11149

wants to merge 2 commits into from

Conversation

swyxio
Copy link
Contributor

@swyxio swyxio commented Oct 8, 2017

Hi! adding the fix for #10103. test/prettier/lint/flow all done and passing.

Copy link
Collaborator

@sebmarkbage sebmarkbage left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert the package-lock.json and results.json files since they're unrelated to this change.

classWithRenderNotExtended,
'Using a class with a render method as a function, ' +
'did you forget to extend React.Component?',
);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's make this a warning instead, so that we can strip this out in production.

if (__DEV__) {
  warning(workInProgress.type.prototype &&
 +      workInProgress.type.prototype.render, '...');
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks sebastian - just doublechecking before I fix - the issue discussion last left saying it should be an invariant outside a __DEV__ block (see here) - are you sure you want it just as a warning?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

regardless, i will resubmit as requested :) really honored to help.

@swyxio
Copy link
Contributor Author

swyxio commented Oct 10, 2017

I screwed up in my own repo and will restart this PR. thanks for the review.

@swyxio swyxio closed this Oct 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants