Closed
Description
I have a reusable component Chart
which I decided to put it up on GitHub. The weird thing is, although it's the exact same file, it works flawlessly while being part of my original project:
import Chart from './chart';
...
render() {
return <Chart />;
}
But it's not working at all once I pull it down as a node package:
import Chart from 'react-chartist-tooltip';
...
render() {
return <Chart />;
}
The error given is Uncaught 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
rendermethod). Try rendering this component inside of a new top-level component which will hold the ref.
but I am not sure if I understand it. Is this intended behavior?
Metadata
Metadata
Assignees
Labels
No labels