Yeah i was tinkering with the same effect but using refs instead:
constcursorRef=React.useRef<HTMLDivElement>(null!);constmoveListener=React.useCallback((event)=>{const{clientX,clientY,target}=event;if(target==='target-id'){// some custom logic to change cursor icon in here}constmouseX=clientX-cursorRef.current.clientWidth/2;constmouseY=clientY-cursorRef.current.clientHeight/2;})return<divclassName='custom-cursor'ref={cursorRef}/></div>;
I dont get the lag with this method, but i'm hitting a bug with css animations when doing this method 😕
Yeah i was tinkering with the same effect but using refs instead:
I dont get the lag with this method, but i'm hitting a bug with css animations when doing this method 😕
is it in the hooks file