0

I am trying to do some calculations for position inside useDrop:hover() .But not able to proceed because component prop is undefined on hover.Following is my implementation for useDrop Hook:

const [{ isOver, canDrop }, drop] = useDrop({
    accept: getAcceptType(schema),
    drop: addComponentOnDrop(schema),
    collect: monitor => ({
      isOver: monitor.isOver({ shallow: true }),
      canDrop: monitor.canDrop(),
    }),
    hover(props, monitor,component) {
      console.log(component);
      debugger
      if (!monitor.canDrop()) {
        return;
      }
    },
  });
5

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.