Skip to content

How to correctly take over the render loop when loading assets #749

Answered by drcmda
alexbrt asked this question in Q&A
Discussion options

You must be logged in to vote

not sure what i am looking at here, there is no console output in that demo. suspense will interrupt the component, it wont even get to the useframe part until the model has loaded, until then r3f will render as usual because nothing has informed it about something taking over the render loop.

useframe executes 60 times per second, i don't think this is the place to set a material btw. that should be useEffect (executes after paint) or useLayoutEffect (executes before paint)

what is that complex animation about though, why do you need to imperatively render it?

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@alexbrt
Comment options

@drcmda
Comment options

Answer selected by alexbrt
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