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

latest releases: v0.19.0, v0.18.8, v0.18.7...
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.