react-beautiful-dnd-next
Version:
Beautiful and accessible drag and drop for lists with React
17 lines (15 loc) • 475 B
JavaScript
// @flow
import invariant from 'tiny-invariant';
import type { Props } from './draggable-types';
export default (props: Props) => {
// Number.isInteger will be provided by @babel/runtime-corejs2
invariant(
Number.isInteger(props.index),
'Draggable requires an integer index prop',
);
invariant(props.draggableId, 'Draggable requires a draggableId');
invariant(
typeof props.isDragDisabled === 'boolean',
'isDragDisabled must be a boolean',
);
};