score:0

i used the workaround which was to give a ref to a div parent from the canvas container, then refer to the canvas element in the dom and set it's style to absolute

working solution is in the codesandbox in the question.

// outer div ref -> element parent div -> canvas style
myref.current.children[0].children[0].style.setproperty(
  "position",
  "absolute",
  "important"
);

Related Query

More Query from same tag