silx-kit / h5web

React components for data visualization and exploration
https://h5web.panosc.eu/
MIT License
195 stars 19 forks source link

Fix React warning with `useGeometry` deps array #1687

Closed axelboc closed 4 months ago

axelboc commented 4 months ago

Introducing a breaking change in the signature of the useGeometry hook to fix #1684

The problem came from passing false or undefined as the value of the params parameter in order to skip updating the geometry (e.g. when the R3F object is hidden). I change the signature of the hook to decouple this feature from the params parameter: the hook now accepts a config object as fourth argument (which also makes the isInteractive boolean more explicit).