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.


Popular posts from this blog

php - How should I create my API for mobile applications (Needs Authentication) -

5 Reasons to Blog Anonymously (and 5 Reasons Not To)

Google AdWords and AdSense - A Dynamic Small Business Marketing Duo