Repository navigation
v4.0.0
Breaking Changes
react-dndandreact-dnd-html5-backendare now peer dependencies instead of
bundled dependencies — install them alongside react-arborist (npm install react-arborist react-dnd react-dnd-html5-backend). This fixes a global singleton
conflict (#319) where apps that also used react-dnd ended up with two independent
copies of the library, causing drag-and-drop to silently break or throw "Cannot have
two HTML5 backends at the same time." Both peers must be v16 (^16), and both are
required even when you pass your owndndBackend/dndManager, because the drag
preview calls intoreact-dnd-html5-backendon every drag. react-dnd v16 is ESM-only,
and react-arborist now ships a single ESM build too (the CommonJSdist/mainbuild is
gone), soimportandrequireload the same copy instead of two copies with
separate React contexts.require("react-arborist")from CommonJS relies on
require(esm), unflagged from Node 22.12 — now theengines.nodefloor, which
package managers check at install time, so installing v4 requires Node ≥ 22.12 even
for bundler and browser consumers. CommonJS TypeScript projects on Node module
resolution needmodule: "nodenext"(TypeScript ≥ 5.8) or"node20"(TypeScript
≥ 5.9);"node16"and"node18"report TS1479. Jest users must add
react-arboristto thetransformIgnorePatternsexception list alongside react-dnd
(see the README). The package also declares anexportsmap:react-arboristand
react-arborist/package.jsonresolve as before, but deep imports such as
react-arborist/dist/module/...are no longer resolvable. Thereactandreact-dom
peer floor rises from 16.14 to 18: the build now importsreact/jsx-runtime
anduseSyncExternalStoredirectly from React, which older versions can't provide
to ESM consumers. (#371)
Fixes
@types/react-windowis now a regular dependency instead of a dev dependency.
react-arborist's public type declarations reference react-window types (onScroll,
outerElementType,innerElementType,tree.list, scroll alignment), so without it
TypeScript reported TS7016 underskipLibCheck: falseand silently typed those as
anyotherwise. (#371)