-
Notifications
You must be signed in to change notification settings - Fork 267
fix: support assert(mounted) for use-setstate-synchronously #1181
Conversation
@Desdaemon please take a look, if you have a moment |
@@ -65,7 +72,6 @@ class _AsyncSetStateVisitor extends RecursiveAstVisitor<void> { | |||
return node.visitChildren(this); | |||
} | |||
|
|||
node.condition.visitChildren(this); |
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.
@Desdaemon removing this looks safe or am I missing something?
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 might cause lints to fail for e.g. if (await ..)
, but I was mostly being cautious when I wrote this.
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.
Hm, I'll add some tests to check this case
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.
Actually, it was not being checked coz of .visitChildren
, I've added a test and fixed the problem
Codecov Report
@@ Coverage Diff @@
## master #1181 +/- ##
=======================================
Coverage 86.11% 86.11%
=======================================
Files 359 359
Lines 8071 8076 +5
=======================================
+ Hits 6950 6955 +5
Misses 1121 1121
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Please write a short comment explaining your change (or "none" for internal only changes)
#1178