Is it even possible to listen for initialization events? Currently the only way to listen for these events would be to access the ref of the component, but by the time we have access to the ref I think the component will have already fired this event.
For example:
import Component, {Config} from 'metal-jsx';
import {BarChart, PieChart} from 'metal-charts';
class MyComponent extends Component {
attched() {
this.refs.chart.on('chartInit', () => {
// This will never actually fire
console.log('fire');
});
}
render() {
return (
<PieChart ref="chart" />
);
}
}
export default MyComponent;
I am trying to add something like https://jsbin.com/boyusuz/3/edit?html,js,output