Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Highcharts from 'highcharts';
class Chart extends Component {
componentDidMount() {
this.chart = new Highcharts[this.props.type || 'Chart'](
this.refs.chart,
this.chartEl,
this.props.options
);
}
Expand All @@ -16,7 +16,7 @@ class Chart extends Component {
}

render() {
return <div ref="chart" />;
return <div ref={el => this.chartEl = el} />;
Copy link
Contributor Author

@elisechant elisechant Sep 10, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here's your issue - you need a "callback ref" to access the underlying DOM element - "the ref callback receives the underlying DOM element as its argument.": https://facebook.github.io/react/docs/refs-and-the-dom.html#adding-a-ref-to-a-dom-element

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting, thanks!

}
}

Expand Down