react-beautiful-dnd migration
An optional Pragmatic drag and drop package that enables rapid migration from react-beautiful-dnd to Pragmatic drag and dropThis package depends on:
React 19
This package does not currently support React 19.
This package provides the react-beautiful-dnd@13 API and uses @atlaskit/pragmatic-drag-and-drop
to power those exports.
At a high level, all you need to do is swap your imports of react-beautiful-dnd in your code to
@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-migration and your drag and drop
experience(s) will now be powered by Pragmatic drag and drop.
This package also includes a codemod to help automatically shift over react-beautiful-dnd@12 and
react-beautiful-dnd@13 to @atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-migration.
Prerequisites
To use @atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-migration you should:
- Already be using
react-beautiful-dnd. If this is a new feature, adopt@atlaskit/pragmatic-drag-and-dropdirectly. - Be using major version 12 or 13 of
react-beautiful-dnd.
Migration steps
Install
@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-migrationRun the codemod client with the command
npx @atlaskit/codemod-cli --parser {tsx|babylon} --extensions ts,tsx,js [relativePath].Select the codemod based on which version of
react-beautiful-dndyou are using:For major version 12, select
adoption-from-rbd-12For major version 13, select
adoption-from-rbd-13
Acknowledge and remove the comments left by the codemod.
Choose drop indicator colors
DragDropContext accepts an optional colors prop that applies to all drop indicators in that
context:
colors | Indicator token |
|---|---|
"standard" (default) | color.border.brand |
"dedicated" | color.border.dropindicator |
Omitting colors preserves the existing appearance. Opting in changes the token role without
changing the indicator's position, dimensions, or drag and drop behavior.
import { DragDropContext } from '@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-migration';
import type {
Colors,
DragDropContextProps,
} from '@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-migration/types';
const colors: Colors = 'dedicated';
export function Board({ children, onDragEnd }: DragDropContextProps) {
return (
<DragDropContext colors={colors} onDragEnd={onDragEnd}>
{children}
</DragDropContext>
);
}Choose the color scheme in your application. The package does not evaluate feature flags. Before
opting in, make sure your theme provides color.border.dropindicator. Custom themes that override
color.border.brand must also provide the dedicated role to preserve their custom indicator color.
Destination backgrounds remain controlled by your application. When opting in, use
color.background.droptarget for the active destination and keep its styling aligned with the
indicator's color scheme.
Troubleshooting
If you run into any issues while migrating, please reach out to us for assistance.