Replace useEffect with useLayoutEffect
alexandernanberg opened this issue · comments
Alexander Nanberg commented
useEffect
wont run before rendering the scene, so there is a flash of content without physics. This is particularly visible when using useRaycastVehicle
(wheels have wrong placement/rotation for a second).
Is there a reason to not use useLayoutEffect
instead? If not I can create a PR
— commented
where? i thought its already using uLE. go ahead and then let's review the pr.
Alexander Nanberg commented
hmm replaced all uE
with uLE
locally and saw the same issue, plus that other things broke. So not related I guess, will keep investigating a bit but closing this issue