stevenpetryk / mafs

React components for interactive math
https://mafs.dev
MIT License
3.24k stars 90 forks source link

Add a hook to create dragable elements #121

Open alexfauquette opened 1 year ago

alexfauquette commented 1 year ago

Fix #120

It introduces useDragElement which simplifies the creation of a draggable component that can be controlled or not:

Two main ways to use them are:

The switch between controlled and uncontrolled behavior is a copy past from @mui codebase

Demo here

Still to do:

vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
mafs ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 6, 2023 0:37am