Closed tendertree closed 7 months ago
boxMove will be called before the ref is called. Did you try with a callback on ref or with the parameter passed to onCreated callback? ie:
<box
ref={(instance) => {
console.log('ref', instance);
}}
onCreated={(instance) => {
console.log('onCreated', instance);
}}
>...</box>
I would say this is by design. onCreated is called immediately after it is created and before react sets the ref. ref doesn't callback how you have it - it just sets.
Thanks! after add callback on ref directly it work out of box :)
try to use animejs with moving animation I try to access object by ref
as my expectation, box rotate by access boxRef However even I allocate function in the
onCreated
it say boxref.current is nullafter I changed onReady doesn't work
I found there is onModelLoaded Event but for model not just simple mesh
is there a way to call the function after box was created to access the ref?