I'm trying to drag and drop these images to the stage.
but when I dropped images, I received this error. Konva.js Konva error: Can not cache the node. Width or height of the node equals 0. Caching is skipped.
The process that I thought of was
What should I do differently to successfully resize images?
https://codesandbox.io/embed/magical-meitner-7gic1?fontsize=14&hidenavigation=1&theme=dark
Make sure you cache a shape when image is loaded.
useLayoutEffect(() => {
if (image) {
shapeRef.current.cache();
}
}, [shapeProps, image, isSelected]);