Closed Xample closed 1 year ago
Okay got it, we need to explicitly provide the dependency on y
if we want to use the second way.
const [y, setY] = useState(0)
useBeforeRender(() => {
setY(y + 0.1)
},undefined, undefined, undefined, [y]))
Hi, noob question, I followed this tutorial: https://brianzinn.github.io/react-babylonjs/guides/animation
While this works:
this fails (it won't update anything)
While they are using the first version in the React tutorials: https://beta.reactjs.org/reference/react/useState#counter-number
Is there any reason, the callback version one is working while the first is failing ?