mercredi 25 mars 2015

setState cause Invariant Violation addComponentAsRefTo


I'm using react-rails with Fluxxor and React. My component is fully functional as long as I stay on the same page.


However, if I change the page by clicking on an other link and come back to my component, when I try to use setState on it, It throw the 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.


My actual code can be found here. The problem seems to be the setState method here. Maybe the refs attribut of my Chosen component can't be re-render ?





Aucun commentaire:

Enregistrer un commentaire