React: Pass function to a child not working
问题 I am having trouble with passing a function to child in React . I read multiple threads on stackoverflow that talk about binding such functions to this or using arrow functions, but still can not resolve it. Basically I need to pass function called datum to d3.select().datum() : class BarChart extends React.Component { constructor(props){ super(props) this.createBarChart = this.createBarChart.bind(this) } componentDidMount() { this.createBarChart() } componentDidUpdate() { this.createBarChart