});
}
- componentWillUpdate() {
- this.nodes = {};
- }
-
componentDidUpdate(_prevProps: WithRouterProps, prevState: State) {
if (prevState.selected !== this.state.selected) {
this.scrollToSelected();
if (this.mounted && this.state.query === query) {
const results: Results = {};
const more: More = {};
+ this.nodes = {};
response.results.forEach(group => {
results[group.q] = group.items.map(item => ({ ...item, qualifier: group.q }));
more[group.q] = group.more;
}
}
- componentWillReceiveProps(nextProps: Props) {
- if (!this.props.selected && nextProps.selected) {
+ componentDidUpdate(prevProps: Props) {
+ if (!prevProps.selected && this.props.selected) {
this.scheduleTooltip();
- } else if (this.props.selected && !nextProps.selected) {
+ } else if (prevProps.selected && !this.props.selected) {
this.unscheduleTooltip();
this.setState({ tooltipVisible: false });
}