Skip to content

xpl/react-leak

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

How to run

npm i
npm run dev

What happens

react-refresh leaks FiberRootNodes from secondary renderers.

When R3F's Canvas unmounts, react-refresh's onCommitFiberRoot sees a late commit (didError=true, !wasMounted && !isMounted) and adds the root to failedRoots / helpersByRoot — never cleaned up.

Click the button, then observe all 16 values stay "alive" in dev mode.

In a production build (no react-refresh) they are properly GC'd.

After pressing "Collect garbage" button in Devtools:

Screenshot 2026-04-30 at 12 25 56 PM

In production build (note the last value is still retained, but that is a separate issue in R3F that I have investigated and reported):

Screenshot 2026-04-30 at 12 32 24 PM

About

A repro of react-refresh leaking FiberRootNodes from secondary renderers

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors