You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// @gate __DEV__it('warns if a setState is called outside of act(...) after a component threw',()=>{letsetValue=null;functionApp({defaultValue}){if(defaultValue===undefined){thrownewError();}const[value,_setValue]=React.useState(defaultValue);setValue=_setValue;returnvalue;}expect(()=>{act(()=>{render(<AppdefaultValue={undefined}/>,container);});}).toThrow();act(()=>{rerender(<AppdefaultValue={0}/>,container);});expect(()=>setValue(1)).toErrorDev(['An update to App inside a test was not wrapped in act(...).',]);});
Specifically
An update to * inside a test was not wrapped in act(...)
is not logged when a prior update threw.failing test (#21766)
What I noticed is that in
react/packages/react-reconciler/src/ReactFiberWorkLoop.new.js
Lines 2855 to 2865 in 27c9c95
the
executionContext
will still equalRetryAfterError
when we would expect a "missing act" warning."missing act" warnings are working as expected with legacy roots.
The text was updated successfully, but these errors were encountered: