Skip to content
Discussion options

You must be logged in to vote

You can render on demand by setting frameloop="demand". This will call invalidate to request a new frame when the scene graph has changed. Libraries like Drei and react-spring will call this for you.

Here are some guides on best practices and how to combine them with the new regress API:

As for pausing when the canvas isn't in view, you can use the observer API to know when the canvas is on screen:

We do this on the website to handle loading states (see component) but you can unmount the …

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@AlexanderProd
Comment options

@CodyJasonBennett
Comment options

@AlexanderProd
Comment options

@CodyJasonBennett
Comment options

Answer selected by AlexanderProd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants