react-legacy-compat weekly downloads statistics
By infinitybuddha29 · npm · Webpack plugins
Restore ReactDOM.findDOMNode under React 19 for legacy dependencies (react-transition-group, react-quill, react-draggable, ...) without patching node_modules. Works with Next.js (Turbopack + webpack), Vite and webpack 5.
react-legacy-compat has 15 recorded weekly downloads on npm, an increase of 25.0% over the past 30 days, ranking #3056 of 3,247 tracked listings.
About react-legacy-compat
react-legacy-compat
Upgraded to React 19 (or to Next.js 15/16, which ships React 19) and now
react-transition-group, react-quill, react-draggable, or some other
legacy dependency crashes with one of:
TypeError: ReactDOM.findDOMNode is not a function
TypeError: (0 , react_dom__WEBPACK_IMPORTED_MODULE_1__.findDOMNode) is not a function
TypeError: (0 , __TURBOPACK__imported__module__...react-dom...findDOMNode) is not a function
Attempted import error: 'findDOMNode' is not exported from 'react-dom'
react-legacy-compat restores findDOMNode for those dependencies —
without editing anything inside node_modules, and without forking
or patching the broken package. One line in your Next.js, Vite or webpack
config and it's fixed.
Requirements
| React / react-dom | >=19.0.0 |
| Framework / bundler | Next.js >=15.3.0 (Turbopack or webpack), Vite >=5.0.0, or webpack >=5.0.0 (webpack 4 not supported) |
| Node | >=18.0.0 |
Install
npm install --save-dev react-legacy-compat
Quick start
Pick your framework or bundler:
Next.js
// next.config.mjs
import { withReactLegacyCompat } from "react-legacy-compat/next";
const nextConfig = {
// ...your existing config
};
export default withReactLegacyCompat(nextConfig);
Works with Turbopack (the default in Next 16, and next dev --turbopack
in Next 15) and with webpack (next --webpack), in both the App Router
and the Pages Router. Your own webpack() function and turbopack
options are kept. A config function ((phase) => config) works too.
Vite
// vite.config.ts
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import { reactLegacyCompat } from "react-legacy-compat";
export default defineConfig({
plugins: [react(), reactLegacyCompat()],
});
webpack
// webpack.config.js
const { reactLegacyCompatWebpack } = require("react-legacy-compat");
module.exports = {
plugins: [reactLegacyCompatWebpack()],
};
That's it — no other configuration, no code changes in your app or in
the broken dependency. Every findDOMNode call site (import { findDOMNode } from "react-dom", ReactDOM.findDOMNode(...), or a plain
require("react-dom")) now gets back the correct DOM node, in dev and in
a production build.
FAQ
Do I need to change anything in the broken package?
No. That's the whole point — nothing inside node_modules is touched or
patched.
Will this break react-dom/client, react-dom/server, or any other
react-dom export?
No. Only the plain react-dom specifier is affected, and only
findDOMNode is added — createPortal, flushSync, createRoot, etc.
all keep working exactly as before. Verified explicitly; see
What's verified.
Does it work with Next.js App Router / Turbopack?
Yes. Next.js uses its own built-in copy of react-dom for the App Router
and your installed one for the Pages Router; withReactLegacyCompat
patches whichever one Next picks, so you never end up with two copies of
React DOM. Verified under Turbopack and webpack, dev and production
build, on Next 16.4, 15.5 and 15.3. Use withReactLegacyCompat here, not the
webpack plugin.
Do I need both the Vite and webpack plugins installed?
No — use whichever one matches your bundler. Both ship in the same
package; vite and webpack are optional peer dependencies, so you only
need the one you actually use installed.
Can I remove this once my dependencies drop findDOMNode?
Yes — it's a shim, not a permanent architectural change. Delete the
plugin from your config and uninstall the package once nothing in your
dependency tree calls findDOMNode anymore.
Does this work with React 18?
It doesn't need to — React 18 already has findDOMNode. The plugin is
verified to not regress an app still on React 18 if you have one in a
monorepo, but there's no reason to add it there.
Something's still broken after adding the plugin.
This plugin only restores findDOMNode. If your dependency also relies
on other APIs React 19 removed (string refs, legacy context,
unstable_renderSubtreeIntoContainer), or is broken under React 19 for
an unrelated reason, this won't fix that — see
Known limitations.
What's verified
npm run verify (see EVALS.md)
exercises, in both dev and production-build mode:
- A direct named import (
import { findDOMNode } from 'react-dom') - The namespace/default-import call style (
ReactDOM.findDOMNode(...)) - A plain CommonJS dependency (
require('react-dom')) - Three real, unmodified npm packages: react-transition-group
(
<CSSTransition>withoutnodeRef), react-quill (a widely-used, now-unmaintained editor component capped at React 18 in its ownpeerDependencies), and react-draggable — including the<DraggableCore> not mounted on DragStart!crash reported in react-draggable#670, which only reproduces on a real drag interaction, not merely on mount <React.StrictMode>- Calling
findDOMNodeon an already-unmounted component (throws, as the original did — it does not return a stale or wrong node) - Every other
react-domexport (createPortal,flushSync,react-dom/client'screateRoot, ...) behaving identically with the plugin enabled - That the plugin doesn't regress an app still on React 18 (differential check)…
Description from the npm listing.
- react
- react19
- react-19
- findDOMNode
- finddomnode
- find-dom-node
- nextjs
- next
- turbopack
- vite
- vite-plugin
- webpack
- webpack-plugin
- compatibility
- migration
- react-transition-group
- react-quill
- react-draggable
README badge
Show your rank in a README or on your website. The badge updates automatically.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Ranking history
Listing placement
Listing placement
Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.
Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.
Recent observations
Full history (592)Similar npm Webpack plugins plugins
All 20 react-legacy-compat alternativesData source
Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.
Listing: https://www.npmjs.com/package/react-legacy-compat. First seen Oct 16, 2026; last successful collection Nov 11, 2026. See the methodology.