// Child component
function Canvas(props) {
let anotherRef // <-- how to assign this?
onMount(() => anotherRef.addEventListener('click', ...))
return (
<div className="canvas-container">
<canvas ref={props.ref} /> {/* Assign the ref to the canvas element */}
</div>
)
// Child component
function Canvas(props) {
let anotherRef // <-- how to assign this?
onMount(() => anotherRef.addEventListener('click', ...))
return (
<div className="canvas-container">
<canvas ref={props.ref} /> {/* Assign the ref to the canvas element */}
</div>
)