react-basic-dnd
TypeScript icon, indicating that this package has built-in type declarations

0.0.0 • Public • Published

Installation

npm

npm install react-basic-dnd

yarn

yarn add react-basic-dnd

pnpm

pnpm install react-basic-dnd

Usage

import { DraggableContainer, DraggableItem } from 'react-basic-dnd';

function App() {
  const [value, setValue] = useState([1, 2]);
  
  const handleChange = () => (newValue) => setValue(newValue);
  
  return (
    <DraggableContainer onChange={handleChange} value={value}>
      {value.map((item) => (
        <DraggableItem key={`item-${item}`}>
          <div
            style={{
              padding: 20,
              border: '1px solid'
            }}
          >
            ITEM {item}
          </div>
        </DraggableItem>
      ))}
    </DraggableContainer>
  )
}

export default App;

Package Sidebar

Install

npm i react-basic-dnd

Weekly Downloads

1

Version

0.0.0

License

MIT

Unpacked Size

9.42 kB

Total Files

9

Last publish

Collaborators

  • kimjh96