Skip to content

Component no longer runs after being installed as a node module #3320

Closed
@gsklee

Description

@gsklee

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'srendermethod). 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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions