gcanti / tcomb-form

Forms library for react
https://gcanti.github.io/tcomb-form
MIT License
1.16k stars 136 forks source link

React 15.2.0 issue #345

Closed kikoanis closed 8 years ago

kikoanis commented 8 years ago

Version

Tell us which versions you are using:

should run without issues

Actual behaviour

After upgrading to react 15.2.0, tcomb-form throws an error: Uncaught TypeError: Cannot read property '_idCounter' of undefined

Steps to reproduce

  1. Upgrade react to 15.2.0
  2. Run a web app and navigate to one of the components that uses tcomb-forms
  3. You should see the error stated above.

    Stack trace and console log

I tracked down the error and it originates in this line:823 in components.js this._reactInternalInstance._nativeContainerInfo._idCounter it seems that _nativeContainerInfo is no longer exists on the _reactInternalInstance and it has changed in react 15.2.0 to be _hostContainerInfo so the above line should read this._reactInternalInstance._hostContainerInfo._idCounter

Now to fix it, I think you check for both (old and new) and select whatever available just to get react compatibility right.

nswanberg commented 8 years ago

Thanks @kikoanis. I can confirm that the bug exists and that the suggested fix works for 15.2.0. My stupid simple fix is only a few characters and only tested for my specific needs though.

gcanti commented 8 years ago

@kikoanis thanks for the detailed report

gcanti commented 8 years ago

Fix released in https://github.com/gcanti/tcomb-form/releases/tag/v0.9.8