Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can i set the useNowFrame object dynamically on react-scenejs ? #85

Open
Allakazan opened this issue Feb 8, 2023 · 2 comments
Open
Labels

Comments

@Allakazan
Copy link

I need to generate the useNowFrames dynamically through the user input. How can i do that ?

@Allakazan
Copy link
Author

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
Copy link
Owner

@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().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants