[test] Fix DevTools regression tests#330
Conversation
318e92c to
98005c3
Compare
Greptile OverviewGreptile SummaryThis PR fixes a React DevTools regression test that was failing in React 17 due to attempting to suspend the root without a fallback component. What ChangedThe original test "should track suspended by in filtered fallback" (React 17+) has been split into three separate tests:
Key Implementation Details
Why This Fix WorksIn React 17, suspending the root without a fallback causes a runtime error. The fix wraps the entire component tree in a root Suspense boundary with a Component instance that receives no promise prop as the fallback. This Component returns null instead of suspending, providing the required non-suspending fallback rendering. The changes follow existing patterns in the codebase and maintain the original test purpose of verifying that DevTools correctly tracks suspended components even when filtered out. Confidence Score: 5/5
Important Files ChangedFile Analysis
|
|
Upstream PR was closed or merged. Code is synced via branch mirror. |
Mirror of facebook/react#35501
Original author: eps1lon
Fixes
-- https://github.com/facebook/react/actions/runs/20886558894/job/60010693969
Regressed in react/react#35456 because in React 17 we can't suspend the root.
It's interesting to test both 17 (because Suspense has a different impl in 17) as well as testing what happens if the root suspends (if the root wouldn't have a dedicated Suspense node, we'd need to change how we handle this case). So we test both React 17 upwards with an explicit root Suspense and React 18 upwards with an implicit one.
Test plan