You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Uncaught (in promise) Error: useTresContext must be used together with useTresContextProvider
... is emitted as an error whenever useTresContext is called without a provideing context. I.e., it's called without, or in the same file as a TresCanvas.
It's not only thrown when users call useTresContext, but also when they call anything that eventually touches useTresContext. This includes commonly used functions like useLoop.
But in that case, the error message doesn't point the user in a helpful direction.
Solution
Offer constructive advise for fixing the most common problems that generate the message. Something like: "use* should be moved to a child component of `."
Create a small write-up on tresjs.org. Link to the write-up in the error message.
Problem
This message ...
... is emitted as an error whenever
useTresContext
is called without aprovide
ing context. I.e., it's called without, or in the same file as aTresCanvas
.It's not only thrown when users call
useTresContext
, but also when they call anything that eventually touchesuseTresContext
. This includes commonly used functions likeuseLoop
.But in that case, the error message doesn't point the user in a helpful direction.
Solution
Alternative
No response
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: