Closed florian-gierlichs closed 3 months ago
I don't think act
usage itself has changed: if you write your tests without a framework, you wrap the state changes within act
, but if using React Testing Library it will wrap actions in act
for you so it's unnecessary.
It seems only the reexport itself changed, but this util was already available. React Testing Library was already using this util to enhance its own act
.
Unless there is something officially announced about act
working differently, the rule should work the same way.
What rule do you want to change?
no-unnecessary-act
Does this change cause the rule to produce more or fewer warnings?
More warnings
How will the change be implemented?
check if no-unnecessary-act rule applies correctly to the new
act
of reactExample code
Since the latest react release it seems to be necessary to wrap state changes with the new
act
of react:Implementation:
How does the current rule affect the code?
This is wrongful (?!) picked up by testing-library/no-unnecessary-act
How will the new rule affect the code?
if possible, consider
act
coming fromreact
could be ignoredAnything else?
No response
Do you want to submit a pull request to change the rule?
No