Izzimach / react-three-legacy

React bindings to create and control a 3D scene using three.js
Other
1.52k stars 128 forks source link

updateComponent error with new monkey-patching code #12

Closed thibauts closed 9 years ago

thibauts commented 9 years ago

I get an error on line 859 of ReactTHREE.js with the latest git code. Everything worked fine with the npm version without monkey-patching.

Uncaught TypeError: Cannot read property 'updateComponent' of undefined

The setup is a simple Scene with a PerspectiveCamera, a PointLight and an Object3D containing a Mesh. The error doesn't happen on first render but does on every subsequent setState.

I'm a little bit short on time right now but will provide test code that reproduces the error if needed.

Izzimach commented 9 years ago

Thanks, I don't think there is a test case for this yet. I think I can modify the current composite test to check this case as well. This probably effects react-pixi as well

Izzimach commented 9 years ago

@thibauts can you check if this fixed your bug?

thibauts commented 9 years ago

Just checked. The error doesn't show up anymore but now render isn't called when component state changes

Izzimach commented 9 years ago

Hm, do you have an example you can post?

thibauts commented 9 years ago

I had the problem at work and can't reproduce it at home with sample code. I'll check again on monday and let you know or close the issue. Thanks for your help !

thibauts commented 9 years ago

I still can't reproduce the bug. It probably was an error on my part. Thanks !

Izzimach commented 9 years ago

No problem, if you find the error go ahead and re-open. Thanks for reporting this.

captDaylight commented 9 years ago

I'm getting this error by requiring the reactthree:

Warning: patching react to work with react-three

Izzimach commented 9 years ago

This is fine, it's mostly there to remind me that there is some monkey-patching going on under the hood that will have to be re-written for each revision.