1
我使用的是阿尔戈利亚反应即时搜索,并且我有要求在每次有结果时显示重叠。React即时搜索:onSearchStateChange获取返回的匹配数
所以我想通过algolia提供的onSearchStateChange函数来处理它。但我仍然困惑从哪里获得总点击。我已经有了一个想法,就像使用通过jquery提取数字显示的结果一样。但我不想这样做。有没有其他方式可以建议?
onSearchStateChange(nextState) {
//must get the number of total hits.
nextState = cleanDeep(nextState);
let filters = transformer(nextState);
this.setState({
searchState: nextState,
filters: filters,
searchChanged: true
})
this.sendToAti(filters);
this.addOverlay(); // <--- function that will show the overlay.
location.hash = qs.stringify(nextState);
}