Skip to content

Migration v2.1 to 5.x

Wayne Van Son edited this page Sep 25, 2020 · 2 revisions

Welcome. I'm sure you're hear because something doesn't work.

If you believe something is missing or that you're still in a pickle, feel free to raise an issue.

Peer Dependencies

Users must install sortablejs and @types/sortablejs because they're listed as peer dependencies. They're no longer included in react-sortablejs

// yarn
yarn add sortablejs react-sortablejs && yarn add -D @types/sortablejs

// npm
npm install --save sortablejs react-sortablejs && npm install --save-dev @types/sortablejs

Plugins

Plugins do not have to be mounted to use. However, you must still activate them in the options.

sortablejs mounts all plugins and does not export them.

-import { Sortable, MultiDrag, ReactSortable } from 'react-sortablejs'
+import { ReactSortable } from 'react-sortablejs'
-
-Sortable.mount(new MultiDrag())

const Component = (props) => <ReactSortable multiDrag={true} {...props} />

dfdf

Clone this wiki locally