React-DOM automatically triggering onClick handler
问题 I have a react-modal which shows some filters. It accepts an isOpen prop which hides or shows the Modal as per the value. The Modal opens successfully when clicked on 'Apply' button, but does not close on clicking 'Cancel'. //Click Handlers in the parent component (filters.js) openAllFilters = () => { this.setState({ showAllFilters: true }); }; closeAllFilters = () => { this.setState({ showAllFilters: false }, () => console.log("state ", this.state.showAllFilters) ); // logs true!); };