gcanti / tcomb-form

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

only a ReactOwner can have refs #271

Closed tamagokun closed 8 years ago

tamagokun commented 8 years ago
Error: Invariant Violation: addComponentAsRefTo(...): Only a ReactOwner can have refs. You might be adding a ref to a component that was not created inside a component's `render` method, or you have multiple copies of React loaded

I am upgrading an app to use React 0.14.3, and whenever I try to render a tcomb-form, I get this error thrown. The form appears to render properly, but through my testing it seems only the first form field actually sets its value properly.

The component that is throwing this error is Textbox.

tamagokun commented 8 years ago

I still need to confirm that there aren't two reacts getting loaded..

gcanti commented 8 years ago

With React 0.14.x you should use tcomb-form 0.7.x

tamagokun commented 8 years ago

I'm using 0.7.10. I had a hunch that maybe something didn't update right with npm, and sure enough.. that was the case. I killed node_modules and re-ran npm install and all is well again.

Sorry for the trouble!