I am using react-rails and browserify. In the application.js I use
// require react
// require react-ujs
Also I use tcomb-form by using
var t=require("tcomb-form")
As the result I saw reactjs is included twice in my asset pipeline.
How should I correctly use reactjs with rails?
EDIT:
by the way, if you see this error in your console, probably you are having the same issue with reactjs got included twice.
[Error] Error: Invariant Violation: addComponentAsRefTo(...): Only a ReactOwner can have refs. This usually means that you're trying to add a ref to a component that doesn't have an owner (that is, was not created inside of another component's render method). Try rendering this component inside of a new top-level component which will hold the ref.
I found that react was being referenced twice in
When I removed the line
it fixed my issues and got rid of the addComponentAsRefTo() error. Please bear in mind that I have not tried to deploy the app yet, but this worked for getting it to crud.