reactjs - ReactDnD: "Invariant Violation: addComponentAsRefTo" Error -
dear people of stackoverflow,
i trying implement drag , drop functionality in react-rails app. however, add dragdropcontext top level component, see error in browser console:
'react.self-0f0e88a….js?body=1:1087 uncaught error: invariant violation: addcomponentasrefto(...): reactowner can have refs. might adding ref component not created inside component's render
method, or have multiple copies of react loaded'
this code have app:
var app = react.createclass({ render: function() { return ( <div> hello </div> ); } }); components.app = dnd.dragdropcontext(html5backend)(app);
adding 1 line of code causing of our phantomjs integration tests fail. appreciated. thanks!
edit: requested, here our index.html.erb render app.
<%= react_component 'components.app' %>
after little digging react version, discovered had 2 versions of react being used @ same time. 1 hidden inside react-rails, while other our node-modules. removed 'require "react"' statement our sprockets file, , seems work now.