Skip to content

Commit 2e7bf8a

Browse files
author
vvo
committed
fix(Hits): always render hits
fixes #1100 I tried to be smart by using shouldComponentUpdate. Turns out it was a bad idea and creates issues rather than solving them.
1 parent cc11d86 commit 2e7bf8a

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed

src/components/Hits.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,10 @@
11
import React from 'react';
22
import map from 'lodash/collection/map';
3-
43
import Template from './Template.js';
5-
64
import hasKey from 'lodash/object/has';
7-
import isEqual from 'lodash/lang/isEqual';
85
import cx from 'classnames';
96

107
class Hits extends React.Component {
11-
shouldComponentUpdate(nextProps) {
12-
return this.props.results.hits.length === 0 ||
13-
this.props.results.hits.length !== nextProps.results.hits.length ||
14-
!isEqual(this.props.results.hits, nextProps.results.hits);
15-
}
16-
178
renderWithResults() {
189
let renderedHits = map(this.props.results.hits, (hit, position) => {
1910
let data = {

0 commit comments

Comments
 (0)