You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, my rendered canvas element does not take up the full width and height of its div parent on first render even though the parent div has width and height set to 100%. As soon as I change the viewport dimensions it snaps and sets its width and height correctly. I upgraded the relevant packages but no luck. Any help would be greatly appreciated and thank you in advance!
Dependencies:
react - 18.2.0,
@react-three/drei - 9.121.5 (upgraded from 9.112.0)
@react-three/fiber - 8.17.14 (upgraded from 8.17.6)
three - 0.173.0 (upgraded from 0.169.0)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi, my rendered canvas element does not take up the full width and height of its div parent on first render even though the parent div has width and height set to 100%. As soon as I change the viewport dimensions it snaps and sets its width and height correctly. I upgraded the relevant packages but no luck. Any help would be greatly appreciated and thank you in advance!
Dependencies:
react - 18.2.0,
@react-three/drei - 9.121.5 (upgraded from 9.112.0)
@react-three/fiber - 8.17.14 (upgraded from 8.17.6)
three - 0.173.0 (upgraded from 0.169.0)
CanvasContainer.jsx
ThreeModel.jsx
GLTFModel.jsx
Initial Render:
Child canvas -

Parent div -

After Resize:
Child canvas -

Parent div -

Beta Was this translation helpful? Give feedback.
All reactions