Need to use parentElement to correctly resize

I have a canvas nested in a CSS grid. To get it to resize correctly I have to use parentElement i.e.

renderer.setSize(canvas.parentElement.clientWidth, canvas.parentElement.clientHeight);

Which seems… clunky at best. :roll_eyes: Is there a better way?

If I use canvas.clientWidth, canvas.clientHeight the canvas keeps the same size :slightly_frowning_face: or worse shrinks. :scream:

TIA