react-xr icon indicating copy to clipboard operation
react-xr copied to clipboard

Improve UX by showing a hint if useHitTest returns negative

Open ThorstenBux opened this issue 2 years ago • 0 comments

Hi,

I've successfully integrated react-xr and I love it. One thing I'd like to improve is adding feedback whenever useHitTest returns negative. In the current implementation of the hook, the callback won't be called if there isn't a hit. For an initial state that would be fine if I only set a state to scanning until the useHitTest hook is called. However, even after a successful hit result. It can happen that later hitTests fail. In that case, I wouldn't get a callback with the current implementation. For better UX I propose adding an else case to return an empty (undefined or null) hit property.

See PR https://github.com/pmndrs/react-xr/pull/275

ThorstenBux avatar May 30 '23 23:05 ThorstenBux