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

Using Theatrejs for React (not R3F) #428

Open
oallouch opened this issue Jun 19, 2023 · 2 comments
Open

Using Theatrejs for React (not R3F) #428

oallouch opened this issue Jun 19, 2023 · 2 comments

Comments

@oallouch
Copy link

Hi,

I was very surprised to see the docs show how to use this lib with R3F, Three.js or plain HTML, but nothing for React.
Worse, the example https://github.com/theatre-js/theatre/blob/main/examples/dom-cra/src/App.js triggers a render at each frame.
Animating outside of the render engine is the main goal of every animation library.
To move a simple div, do we have to use a ref and set manually its transform property (like we would with any HTML component) ?
Do you plan to add an editable.div-like notation ?

Note that I react this way because I think the project could be huge, and not only for R3F, which I know and love.

Thx,

Olivier

@clementroche
Copy link
Contributor

https://github.com/studio-freight/satus/blob/main/libs/theatre/index.js

This can be helpful, i faced the same issue. Thank to those hooks/context you can use theatre whenever you want in your app

@oallouch
Copy link
Author

Exactement, Clément.
I also coded those, and a TheatreDiv that manages "translate" and "opacity".

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

No branches or pull requests

2 participants