react-three-arjs icon indicating copy to clipboard operation
react-three-arjs copied to clipboard

Problem on run ARCanvas from conditional render

Open rafelis1997 opened this issue 3 years ago • 3 comments

When conditionally crendereing the ARCanvas this message is displayed

And this shows in the console ar.js:133 Uncaught TypeError: Cannot set properties of null (setting 'orientation') at HTMLVideoElement.video.onloadedmetadata (ar.js:133:63)

I think it's related to useMemo, maybe use memo instead could fix it?

rafelis1997 avatar Jun 14 '22 22:06 rafelis1997

when changing the device orientation the canvas is corrected and works well, so it's something related with inital state properties

rafelis1997 avatar Jun 14 '22 22:06 rafelis1997

Hi @rafelis1997, thank you! I set up an example using conditional rendering for the arcanvas. Seems to work fine turning it on and off, could you try it out please -> https://codesandbox.io/s/sparkling-tdd-82xrpl?file=/src/index.js. Otherwise I would need more insights in your code. Maybe some issues with starting in landscape or what are yout trying to do?

j-era avatar Jul 26 '22 13:07 j-era

@j-era thanks for the response, I will try your solucionado

rafelis1997 avatar Jul 26 '22 15:07 rafelis1997