Hi there! I’m trying to show a popup onclick of a 3d model but the function is calling itselt twice and sometimes thrice.What am I doing wrong.
<mesh
ref={ref}
castShadow
{...events}
{...props}
>
<Mymodel position={[0, 4.5, 0]} onClick={useCallback((e:any)=>confirm("I'm clicked"+props.uid),[props.uid])}/>
</mesh>
I’m calling this model many times in my scene that’s why I’ve given every model a unique id (uid). onlclick of one model I want to see if thats the right id or not with respect to model.