componentDidUpdate(prevProps) { super.componentDidUpdate(prevProps); if (prevProps.selected && !this.props.selected) { this.leafletElement.closePopup(); } if (!prevProps.selected && this.props.selected) { this.leafletElement.openPopup(); } }
componentDidMount() { super.componentDidMount(); if (this.props.selected) { this.leafletElement.openPopup(); } this.leafletElement.on("click", () => this.props.onSelectStein(this.props.id) ); }