I have a component that creates a canvas another and another that controls what happens to it on events:
const Parent = () => { const [canvasRef, zoom,