github stevenpetryk/mafs v0.6.0
v0.6.0: MovablePoint and setPoint!

latest releases: v0.21.0, v0.20.1, v0.20.0...
2 years ago

MovablePoint can now be used directly

No longer are users stuck using useMovablePoint—now you can bypass that abstraction and use MovablePoint itself.

const [point, setPoint] = useState([0, 0])

<MovablePoint
  point={point}
  onMove={setPoint}
/>

useMovablePoint was only ever a nice wrapper around useState for movable points.

setPoint

Similarly, useMovablePoint now exposes a setPoint function to make it easy to move your point programmatically!

const point = useMovablePoint([0, 0])

function onClick() {
  point.setPoint([1, 0])
}

Don't miss a new mafs release

NewReleases is sending notifications on new releases.