Implement with three-devtools #912
Unanswered
SiegeSailor
asked this question in
Q&A
Replies: 1 comment 3 replies
-
in its essence r3f is just a custom renderer that takes jsx components and renders them into a target, which is a regular threejs scene. <Canvas onCreated={state => {
if (typeof __THREE_DEVTOOLS__ !== 'undefined') {
__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent('observe', { detail: state.scene }));
__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent('observe', { detail: state.gl }));
}
})> notice that react users have dev tools for free https://twitter.com/0xca0a/status/1135583842683838464 though threes are certainly more specific and relevant. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Here is the example code for three-devtools to observe our scene and renderer.
The question is, how do we imply this tool with
react-three-fiber
since we are usingJSX
? From my understanding,<Canvas />
is equivalent to renderer, and the way we insert components into the<Canvas />
tag is equivalent to the way we usescene.add()
. In that way, we actually don't have a declarative variable for both scene and renderer, so what do we use three-devtools withreact-three-fiber
?Beta Was this translation helpful? Give feedback.
All reactions