I got false all the time, when I use updateState() to update the value of varToF, But It’s not effect in three.js module, What should I do if I want using the change varToF on rotateBox() ?
useState is not effect in three.js?
refer to the original react+three baby example that demonstrates state changes Basic demo - CodeSandbox
in react, by definition, the view is the outcome of a function of state. if that’s not the case and you’re somehow sidestepping that it would be a mistake, or some kind of anti pattern.
This is just for simplicity. In fact, my program is very complex. I need state variables to control the monitoring of mouse click events to handle different logic. However, my state variables change externally, but remain unchanged inside three.js, so I just can’t implement my logic.