I noticed, preventDefault()
doesn't work if called inside of reducer. As you can see in this sample. The target element, doesn't allow drop(pointer shows invalid icon), when a dragged element is enter or hovering it, even though preventDefault()
is being called.
But when when I move the calling of preventDefault()
at the handler(the function that receives the event), as you can see in this sample. The target element now allows drop operations.
In one of the projects that I been working on, I needed or I want to be sure that the state that I'm reading is the most recent, when deciding to called or not the preventDefault()
, that's when I encounter this behavior.