How can i set the useNowFrame object dynamically on react-scenejs ?
Allakazan opened this issue · comments
Bruno Marques commented
I need to generate the useNowFrames dynamically through the user input. How can i do that ?
Bruno Marques commented
scenes.map((scene, si) => {
scene.layers.map((layer, li) => {
const sceneItem = currentScene.getItem(`.txt-${si}-${li}`);
const frame1 = useNowFrame(sceneItem.getItem(li));
console.log(frame1)
})
})
Some code for example
Daybrush (Younkue Choi) commented
@Allakazan
sorry. useNowFrame (i.e. reactive component) cannot be called dynamically and its number cannot be changed.
If you're like me, I recommend using item.getNowFrame().