-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Remove always true if statement #2271
Conversation
Since `isStateful` is a function, it will always be truthy, this PR simplifies an if-statement related to it.
@@ -641,29 +641,27 @@ class ReactSixteenAdapter extends EnzymeAdapter { | |||
)); | |||
} | |||
|
|||
if (isStateful) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This probably was meant to be isStateful(component)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Truth be said, this was my first contact with this code, so I'm not a 100% on the full context of this (even though I'm opening a PR in this code block).
By looking at the context, however, I agree that this really should be isStateful(Component)
, so I'm updating to this!
The change is now great - but I think you've found a bug, and before fixing it, we should add a test to prevent it from getting broken again. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great job
@pedrocunial any interest in completing this PR with a regression test? |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@pedrocunial are you no longer interested in completing this PR? Either way, I'd prefer it stay open so it can be coopted by someone else. |
@ljharb, yeah, sorry I'm not really interested in continuing this. Sorry for the whole confusion and also for closing the PR itself. |
I believe this was subsumed by #2476. |
Since
isStateful
is a function, it will always be truthy, this PR simplifies an if-statement related to it.