-
I have a component using Leva with a state. The state is used in the const [step, setStep] = useState(10);
useControls({
x: {
value: 0,
step: step
}
}); However when state is updated, the step of the control is not updated Demo: https://codesandbox.io/s/leva-dynamically-change-properties-oi411h?file=/src/App.tsx Expected: the step of |
Beta Was this translation helpful? Give feedback.
Answered by
dbismut
May 7, 2022
Replies: 1 comment 1 reply
-
Put |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
Ivan-1F
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Put
step
in a dependency array as the last argument ofuseControls
.