finds.dev← search

// the find

gaearon/react-hot-loader

★ 12,177 · JavaScript · MIT · updated Feb 2023

Tweak React components in real time. (Deprecated: use Fast Refresh instead.)

React Hot Loader is the webpack-era solution for updating React components in the browser without a full page reload, preserving component state across edits. It predates React Fast Refresh and solved a genuinely hard problem: proxying component classes so React's reconciler would treat updated code as the same component. The README itself tells you to uninstall it if your bundler supports Fast Refresh — which all of them do now.

The component proxy approach is technically interesting: rather than remounting, it mutates the existing class prototype in place, which is why state survives edits. Hook reload heuristics (dependency-array-based decisions about what to preserve vs. re-run) show real thought about the semantics, not just 'reload everything'. The example coverage is broad — SSR, Electron, TypeScript without Babel, code splitting, Preact — which tells you the authors actually dog-fooded it across real setups. Test suite covers proxy consistency, lifecycle, babel transforms, and prod/dev splits separately, which is the right structure for a tool this close to a runtime.

It's deprecated. The README says so in the first paragraph, and the last commit was February 2023. React Fast Refresh is built into Next.js, Vite, CRA 4+, and React Native — there is no realistic modern project where you'd reach for this instead. The hook support was always a workaround: it required a patched react-dom fork (@hot-loader/react-dom) and still had a known list of failure modes around constructor changes and hook ordering. The TypeScript path was also awkward — you had to route TS through Babel and lose type checking at compile time, relying on a separate fork-ts-checker process. These aren't things that got fixed; the project was just superseded.

View on GitHub → Homepage ↗

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →