-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Three-fiber OrbitControls and "R3F: Hooks can only be used within the Canvas component!" error #37
Comments
Thank you. The downside of this library is that we see all kinds of errors I know nothing about :)
Too bad ipyreact doesn't show a tracktrace, I think we should fix that. |
@maartenbreddels Thanks for responding so quickly :) I'll continue to do some digging and update this issue if I find anything! Btw: If it can help debugging why you're seeing a different error here is the environment I tested it on: (I'm using JupyterLab btw)
|
hi @Krande , You can clone the repo and type Screen.Recording.2023-10-02.at.16.02.08.mov |
Opening this so I don't forget to get back to this, this can now work really well with ipyreact, will follow up later! |
I've added an example notebook: https://github.com/widgetti/ipyreact?tab=readme-ov-file#bundled-es-modules-for-threejs This shows how to build a bundle, and finally make a composable app with it using solara: |
Hey!
I just discovered this library and think it looks really interesting!
I did a small experiment to see if ipyreact could replace some stuff I've made in the past using pythreejs. However I ran into a minor snag when trying to bring in an
<OrbitControls/>
component that I was wondering any of you might help me solve?I should also mention that my frontend experience is limited, so I might (hopefully) be asking a dumb question and it's also likely that my question isn't really related to ipyreact itself:)
Anyways, I started by using the ESM>Playground where I created a minimal three-fiber example hoping I would be able to get this to work in my jupyterlab environment.
Okay, the controls and everything (except I was unable to get tailwind css working) seems to work as expected.
However, when copying this into my ipyreact environment tt seems that using the
<OrbitControls/>
component generates the errorBy simply removing the
<OrbitControls/>
element I was able to get the example workingWhen searching for an answer I found this but I'm not that familiar with the r3f hooks concept that I immediately understand how to fix it.
Anyone pointing me in the direction of solving this would be much appreciated!
Best Regards
Kristoffer
The text was updated successfully, but these errors were encountered: