I'm investigating an interaction glitch with the crop tool, and tangentially noticed that componentWillUnmount assumes it won't occur in the middle of the crop interaction. I imagine this is true in most applications, but it feels safer to ensure the events get torn down. Thoughts?
componentWillUnmount() {
if (this.resizeObserver) {
this.resizeObserver.disconnect()
}
// Ensure all event listeners are removed
this.unbindDocMove()
}
https://github.com/sekoyo/react-image-crop/blob/0a19cbad4fbf988cb178e00f15823d96e634992d/src/ReactCrop.tsx#L172-L176
I'm investigating an interaction glitch with the crop tool, and tangentially noticed that
componentWillUnmount
assumes it won't occur in the middle of the crop interaction. I imagine this is true in most applications, but it feels safer to ensure the events get torn down. Thoughts?