Problem
@aehrc/smart-forms-renderer depends on react-beautiful-dnd for group table row reordering:
packages/smart-forms-renderer/package.json:56 declares "react-beautiful-dnd": "^13.1.1"
packages/smart-forms-renderer/package.json:87 declares "@types/react-beautiful-dnd": "^13.1.8" as a devDependency
react-beautiful-dnd has been sunsetted by Atlassian and receives no further releases. The last publish is 13.1.1 from 2022. The repository already documents the consequence, in packages/smart-forms-renderer/src/utils/silenceWarnings.ts:43-53:
This function monkey-patches console.error to silence a specific warning from react-beautiful-dnd about a soon to be deprecated feature.
The project is sunsetted, so it is unlikely to be fixed.
So the renderer currently carries an unmaintained dependency plus a console.error monkey-patch that exists only to hide that dependency's output.
Two further observations while looking at this:
-
The monkey-patch does not actually work against the React version currently resolved in the lockfile (18.3.1). React passes console.error the unformatted template string 'Warning: %s: Support for defaultProps will be removed from memo components in a future major release. Use JavaScript default parameters instead.%s', with the component name supplied as a separate argument. The patch tests args[0].includes('Warning: Connect(Droppable): Support for defaultProps ...'), which never matches that template. The warning is therefore still printed today, and the patch is dead code that also replaces the global console.error for every consumer of BaseRenderer.
-
The renderer's peer range is react: ^18.0.0 || ^19.0.0, but react-beautiful-dnd declares a React peer range of ^16.8.5 || ^17.0.0 || ^18.0.0, so React 19 consumers already install it against an unsatisfied peer.
Suggested resolution
@hello-pangea/dnd is the maintained fork of react-beautiful-dnd, created from that codebase and kept API-compatible. Version 18.0.1 declares react: ^18.0.0 || ^19.0.0 and react-dom: ^18.0.0 || ^19.0.0, which matches the renderer's own peer range exactly. It also ships its own TypeScript types, so @types/react-beautiful-dnd becomes redundant.
The fork has fixed the underlying cause of the warning: it no longer assigns defaultProps to the memoised Connect(Droppable) component, and instead merges defaults through an attachDefaultPropsToOwnProps helper. That means the monkey-patch can be deleted rather than retargeted.
The benefits are:
- Removes an unmaintained dependency from the published package.
- Deletes a
console.error monkey-patch, restoring normal error reporting for consumers.
- Drops a redundant
@types package.
- Removes an unsatisfied React 19 peer dependency.
The affected call sites are contained:
packages/smart-forms-renderer/src/components/FormComponents/Tables/GroupTableBody.tsx (DragDropContext, Droppable, DropResult)
packages/smart-forms-renderer/src/components/FormComponents/Tables/GroupTableRow.tsx (Draggable)
packages/smart-forms-renderer/src/utils/silenceWarnings.ts and its call site in packages/smart-forms-renderer/src/components/Renderer/BaseRenderer.tsx
Neither library appears in the package's generated lib/ type declarations, so this is not a public API change.
Out of scope
The renderer also depends on react-dnd and react-dnd-html5-backend for attachment file drop (hooks/UseFileDrop.ts, components/FormComponents/AttachmentItem/AttachmentItem.tsx). That is a separate concern and should be left untouched here. Consolidating the two drag-and-drop libraries is a larger design discussion worth its own issue.
Problem
@aehrc/smart-forms-rendererdepends onreact-beautiful-dndfor group table row reordering:packages/smart-forms-renderer/package.json:56declares"react-beautiful-dnd": "^13.1.1"packages/smart-forms-renderer/package.json:87declares"@types/react-beautiful-dnd": "^13.1.8"as a devDependencyreact-beautiful-dndhas been sunsetted by Atlassian and receives no further releases. The last publish is 13.1.1 from 2022. The repository already documents the consequence, inpackages/smart-forms-renderer/src/utils/silenceWarnings.ts:43-53:So the renderer currently carries an unmaintained dependency plus a
console.errormonkey-patch that exists only to hide that dependency's output.Two further observations while looking at this:
The monkey-patch does not actually work against the React version currently resolved in the lockfile (18.3.1). React passes
console.errorthe unformatted template string'Warning: %s: Support for defaultProps will be removed from memo components in a future major release. Use JavaScript default parameters instead.%s', with the component name supplied as a separate argument. The patch testsargs[0].includes('Warning: Connect(Droppable): Support for defaultProps ...'), which never matches that template. The warning is therefore still printed today, and the patch is dead code that also replaces the globalconsole.errorfor every consumer ofBaseRenderer.The renderer's peer range is
react: ^18.0.0 || ^19.0.0, butreact-beautiful-dnddeclares a React peer range of^16.8.5 || ^17.0.0 || ^18.0.0, so React 19 consumers already install it against an unsatisfied peer.Suggested resolution
@hello-pangea/dndis the maintained fork ofreact-beautiful-dnd, created from that codebase and kept API-compatible. Version 18.0.1 declaresreact: ^18.0.0 || ^19.0.0andreact-dom: ^18.0.0 || ^19.0.0, which matches the renderer's own peer range exactly. It also ships its own TypeScript types, so@types/react-beautiful-dndbecomes redundant.The fork has fixed the underlying cause of the warning: it no longer assigns
defaultPropsto the memoisedConnect(Droppable)component, and instead merges defaults through anattachDefaultPropsToOwnPropshelper. That means the monkey-patch can be deleted rather than retargeted.The benefits are:
console.errormonkey-patch, restoring normal error reporting for consumers.@typespackage.The affected call sites are contained:
packages/smart-forms-renderer/src/components/FormComponents/Tables/GroupTableBody.tsx(DragDropContext,Droppable,DropResult)packages/smart-forms-renderer/src/components/FormComponents/Tables/GroupTableRow.tsx(Draggable)packages/smart-forms-renderer/src/utils/silenceWarnings.tsand its call site inpackages/smart-forms-renderer/src/components/Renderer/BaseRenderer.tsxNeither library appears in the package's generated
lib/type declarations, so this is not a public API change.Out of scope
The renderer also depends on
react-dndandreact-dnd-html5-backendfor attachment file drop (hooks/UseFileDrop.ts,components/FormComponents/AttachmentItem/AttachmentItem.tsx). That is a separate concern and should be left untouched here. Consolidating the two drag-and-drop libraries is a larger design discussion worth its own issue.