diff --git a/src/components/SearchBox/SearchBox.tsx b/src/components/SearchBox/SearchBox.tsx index d6122362..9f78826e 100644 --- a/src/components/SearchBox/SearchBox.tsx +++ b/src/components/SearchBox/SearchBox.tsx @@ -132,12 +132,13 @@ export class SearchBox extends React.PureComponent ({ - item: this.props.getItemById(res.meta)!, - score: res.score, - })); - - results.sort((a, b) => b.score - a.score); + const results = this.state.results + .filter(res => this.props.getItemById(res.meta)) + .map(res => ({ + item: this.props.getItemById(res.meta)!, + score: res.score, + })) + .sort((a, b) => b.score - a.score); return (