-
Notifications
You must be signed in to change notification settings - Fork 657
add rule for no setState in componentDidUpdate and tests #433
Conversation
This only covers
I wouldn't worry about checking if the |
@sebmck , so it sounds like the One question from the docs: https://reactjs.org/docs/react-component.html#componentdidupdate
Should wrapped this.setState be an exception in the lint rule? |
Yeah don't bother handling To handle the conditional case you could do:
|
a7bb4d2
to
b6d2c7a
Compare
@sebmck had to modify your suggestion with 2 path.findAncestry calls. let me know if that doesn't work |
Looks good to me. We're only incurring the |
Thank you! |
rule
from the sheet in #341
the rule is for ES5, but I added checks for ES6 class components. Let me know if that's not correct. Happy to make changes.