Unexpected behavior with multiple gltfjsx models #907
Unanswered
SebastianDeuss
asked this question in
Q&A
Replies: 1 comment 2 replies
-
you have a side effect, something that's bleeding over to the rest. i would expect each component to be self contained and isolated, component c receiving a prop shouldn't affect component a and b. we need to see the model components code. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I got a scrolling page, where I use
<View/>
to display the same gltfjsx component three times.Depending on the scrolling position, the models transition to a predefined pose (using spring) e.g.:
the position is provided in a prop
pose={currentSlide}
When I replace currentSlide with a number like 0, all models pick their pose by that number.
pose={0} is now applied to all models
Is this expected? I would like to use one component and different props to change position and rotation like in https://codesandbox.io/s/re-using-gltfs-dix1y?file=/src/App.js
What could cause this behavior?
Beta Was this translation helpful? Give feedback.
All reactions