@react-three/xr
Version:
VR/AR for react-three-fiber
23 lines (22 loc) • 1.11 kB
JavaScript
import { jsx as _jsx } from "react/jsx-runtime";
import { forwardRef, useImperativeHandle, useRef } from 'react';
import { useInteraction } from './hooks.js';
/**
* @deprecated Just use `<group onClick... />`
*/
export const Interactive = forwardRef(({ onHover, onBlur, onSelectStart, onSelectEnd, onSelect, onSqueezeStart, onSqueezeEnd, onSqueeze, onMove, children, }, passedRef) => {
const ref = useRef(null);
useImperativeHandle(passedRef, () => ref.current);
useInteraction(ref, 'onHover', onHover);
useInteraction(ref, 'onBlur', onBlur);
useInteraction(ref, 'onSelectStart', onSelectStart);
useInteraction(ref, 'onSelectEnd', onSelectEnd);
//useInteraction(ref, 'onSelectMissed', onSelectMissed)
useInteraction(ref, 'onSelect', onSelect);
useInteraction(ref, 'onSqueezeStart', onSqueezeStart);
useInteraction(ref, 'onSqueezeEnd', onSqueezeEnd);
//useInteraction(ref, 'onSqueezeMissed', onSqueezeMissed)
useInteraction(ref, 'onSqueeze', onSqueeze);
useInteraction(ref, 'onMove', onMove);
return _jsx("group", { ref: ref, children: children });
});