Izzimach / react-three-legacy

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

issues with react 15.2 (?) #82

Closed eeh closed 8 years ago

eeh commented 8 years ago

Hi there,

I'm starting to have random trouble with my 3d components after upgrading to react 15.2.

I keep hitting this:

react-three-commonjs.js:2190 Uncaught TypeError: prevChild.getNativeNode is not a function
    moveChild @ react-three-commonjs.js:2190
    _updateChildren @ ReactMultiChild.js:328
    updateChildren @ react-three-commonjs.js:2225
    receiveComponent @ react-three-commonjs.js:2637
    receiveComponent @ react-three-commonjs.js:2372
    receiveComponent @ ReactReconciler.js:131
    newReceiveComponent @ react-three-commonjs.js:334
    updateChildren @ ReactChildReconciler.js:94
    _reconcilerUpdateChildren @ ReactMultiChild.js:213
    _updateChildren @ ReactMultiChild.js:310
    updateChildren @ react-three-commonjs.js:2225
    perform @ Transaction.js:138
    THREERenderer_componentDidUpdate @ react-three-commonjs.js:1130
    invokeComponentDidUpdateWithTimer @ ReactCompositeComponent.js:66
    notifyAll @ CallbackQueue.js:67
    close @ ReactReconcileTransaction.js:79
    closeAll @ Transaction.js:204
    perform @ Transaction.js:151
    perform @ Transaction.js:138
    perform @ ReactUpdates.js:91
    flushBatchedUpdates @ ReactUpdates.js:178
    close @ ReactUpdates.js:49
    closeAll @ Transaction.js:204
    perform @ Transaction.js:151
    perform @ ReactUpdates.js:91
    flushBatchedUpdates @ ReactUpdates.js:178
    closeAll @ Transaction.js:204
    perform @ Transaction.js:151
    batchedUpdates @ ReactDefaultBatchingStrategy.js:63
    batchedUpdates @ ReactUpdates.js:99
    dispatchEvent @ ReactEventListener.js:150

In different circumstances. I think it may be when navigating away/replacing 3d components, but i'm not quite sure.

For the time being I downgraded to react 15.1, but more users will probably hit this...

Regards, Emil

Izzimach commented 8 years ago

Thanks for the heads-up! This is the problem with referencing internal React stuff :disappointed:

Izzimach commented 8 years ago

@eeh can you check if 99395bce54db9c9c97777bde66ed903ce373413a fixes this? If so I'll publish to npm.

eeh commented 8 years ago

From what I can see, it seems to work. At least some of the 3d things in my application seems to work as they should.

Did not do any extensive testing, but I think it's good!

Thanks for the quick fix!

Izzimach commented 8 years ago

Great! Not sure if this fixes everything but it passes all tests for both 15.2 and 15.1 so I'm going to publish it.