react-jquery-sortable
Usage
- Include jQuery and jQuery UI globally (this is required because of a jQuery UI limitation)
- Configure webpack to support
import '$' from 'jquery'
(seeexternals
inwebpack.config.common.js
) - Create the
Sortable
(seeExample.jsx
).
Code Example
;; { // - Sortable options are passed as props // - When an item is dropped, onChange is called with a list of ids that represents the new order // - Each child must have an id. The id is used to identify the order of the children. return <Sortable forcePlaceholderSize handle=".handle" onChange= placeholder="placeholder" ...props > widgets </Sortable> ;}
Setup
yarn
yarn start
# Visit http://localhost:8080