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

Do not declare isReactComponent #25

Merged
merged 4 commits into from
Sep 8, 2018
Merged

Conversation

jacekradko
Copy link
Contributor

@jacekradko jacekradko commented Sep 6, 2018

With the React 16.5.0 release, this component's use of isReactComponent breaks React's shouldConstruct check. Here is a more detailed explanation of the problem: facebook/react#13580

Here is a working demo of the bug: https://codesandbox.io/s/nm1nn0374

@coveralls
Copy link

coveralls commented Sep 6, 2018

Coverage Status

Coverage remained the same at 100.0% when pulling 5bf110c on jacekradko:master into 855b112 on ethanselzer:master.

@@ -430,14 +430,10 @@ export default class extends React.Component {
return e.touches[0];
}

isReactComponent(reactElement) {
Copy link
Owner

Choose a reason for hiding this comment

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

Hi @jacekradko - What is your opinion of keeping the method but changing the name togetIsReactComponent to avoid name collision? I like the method because its name expresses its purpose.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good to me. Conveying intent is important.

@ethanselzer
Copy link
Owner

Hi @jacekradko - Thanks for identifying this issue and providing a fix. You are awesome! I made a comment on the code. Please have a look and let me know your thoughts. Thanks!

@jacekradko
Copy link
Contributor Author

@ethanselzer I made the changes as you suggested.

Same in react-hover-observer

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

Successfully merging this pull request may close these issues.

3 participants