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
i bumped into this today @FarazzShaikh i think we should revert. this isn't about useEffect, but just threejs not being able to set certain properties without needsUpdate, which isn't a bug but expected behaviour as useEffect runs after render. i think we shouldn't mask that with lifecycles.
the onload imo leads to bad coding practices and i'm sure pretty much all loaders have cases like that, everything that's setting buffers or shader defines must have needsUpdate in three if it runs after the object has been rendered out once.
✅ this works (this is how you'd do it in vanilla, too, when the object has been rendered already)
three
version: 0.140.2@react-three/fiber
version: 8.0.7@react-three/drei
version: 9.7.1node
version:npm
(oryarn
) version:Problem description:
Textures from
useTexture
don’t receive therepeat
property when it’s set in auseEffect
. It does work when set in auseLayoutEffect
.This is probably due to the internal
useEffect
heredrei/src/core/useTexture.tsx
Line 16 in 6964043
Relevant code:
Suggested solution:
Not sure, maybe to change the internal
useEffect
to auseLayoutEffect
The text was updated successfully, but these errors were encountered: