React Setting state inside of a function
问题 I am using some d3 for visualization and decided to also use reactstrap. Basically clicking a circle in d3 will result in the reactstrap element Collapse to appear. I am not finding any luck with setState... I am doing all my react code in componenetDidMount(), inside of componentDidMount(), I have a function update(), and in update, I have a function called click, and when click triggers, it does: this .setState({ collapse: !this.state.collapse }); It doesn't work, and I lack the fundamental