I'm using the react-rails gem, and everything works fine until I press the back button of the browser and go to the previous page. I get the error below.
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 get the same error when I press the back button of the browser, or go back a page with a keyboard press. Please help me out!