Web | Mobile |
---|---|
This project is documentation of a study to develop the Drag & Drop visual interaction without HTML Drag & Drop API
.
- React
- TypeScript
- jest
- vite
- pnpm
- react-device-detect
-
Before you start, install
pnpm
package to globalnpm install --global pnpm
-
Docker install required
-
Clone the repo
git clone https://github.com/VannsKang/React-Draggable-Box-Without-HTML-API.git
-
Install NPM packages
pnpm install
-
Run the project
pnpm dev
-
Build the package
pnpm build
-
Test the project
pnpm test:unit
-
Run the Docker inside
./docker
folderdocker-compose up
-
The parent component
Draggable
and child componentBOX
were designed as<Draggable> <Box /> </Draggable>
-
Not using
HTML Drag & Drop API
. Configured without using any 3rd parties or libraries -
Declare a certain draggable area for the draggable box.
.
├── public/
│ └── index.html
├── src/
│ ├── components/
│ │ ├── Box/
│ │ │ ├── index.tsx
│ │ │ └── index.test.tsx
│ │ └── Draggable/
│ │ ├── index.tsx
│ │ └── index.test.tsx
│ ├── styles/
│ │ ├── App.css
│ │ └── index.css
│ ├── App.test.ts
│ ├── App.tsx
│ ├── index.tsx
│ └── ...
├── package.json
├── tsconfig.json
└── ...
dependencies:
react 17.0.2
react-device-detect 2.1.2
react-dom 17.0.2
devDependencies:
@testing-library/jest-dom 5.16.2 identity-obj-proxy 3.0.0
@testing-library/react 12.1.4 jest 27.5.1
@testing-library/user-event 13.5.0 jest-environment-jsdom 27.5.1
@types/react 17.0.40 typescript 4.6.2
@types/react-dom 17.0.13 vite 2.8.6
@vitejs/plugin-react 1.2.0 vite-jest 0.1.4
This project is optimized & tested in Chrome
.