Open
Description
Version
"react": "19.1.0",
"react-dom": "19.1.0"
OS: Ubuntu 24.04 and MacOS 15.3.2
Overview
Our React-App uses Icons which are lazy()
loaded and surrounded by a <Suspense>
. We are now seeing issues for components using one of the Icons when also a state is updated within a useEffect()
.
While updating from React 18.3.1 to React 19.1.0 a few of our tests are running forever (infinite loop?).
We were able to narrow it down to the React upgrade and created a minimal test case for this.
Related Issues
#29930: [React 19] infinite loop when using React lazy & functional formAction together
Steps To Reproduce
- Open CodeSandbox (Or use the GitHub backup: https://github.com/Jens-n11/react-bug-suspense)
- Download the code
- Run
yarn install
- Run
yarn test:only-hanging
- Will load forever
Cases where the bug does not happen:
- Using React 18.3.1 instead of 19
- When rendering less than 3 Icons
- When running all tests (so having a working test-case right before)
yarn test:all
- Doing no state update from the useEffect