How to use the react-instantsearch/connectors.connectInfiniteHits function in react-instantsearch

To help you get started, weā€™ve selected a few react-instantsearch examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github BeeDesignLLC / GlutenProject.com / components / SearchResults.js View on Github external
{hasMore ? (
            <button>
              Load More
            </button>
          ) : (
            
          )}
        
      )}
    
  )
}

export default withRouter(connectInfiniteHits(connectStateResults(SearchResults)))
github tech-conferences / confs.tech / src / components / ConferenceList / ConferenceList.tsx View on Github external
return _sortBy(Object.keys(conferences), conference =&gt; {
    return parseInt(conference.replace('-', ''), 10);
  });
}

function AddConferenceLink() {
  return (
    <div>
      
        Add a conference
      
    </div>
  );
}

export default connectInfiniteHits(ConferenceList);
github algolia / react-instantsearch / examples / react-native-query-suggestions / App.js View on Github external
onEndReached={onEndReached}
    onScroll={() =&gt; {
      Keyboard.dismiss();
      removeSuggestions();
    }}
    ItemSeparatorComponent={() =&gt;
github hummingbird-me / kitsu-mobile / src / screens / Sidebar / Blocking.js View on Github external
data={hits}
      keyboardShouldPersistTaps={'handled'}
      removeClippedSubviews={false}
      onEndReached={onEndReached}
      onEndReachedThreshold={0.5}
      initialNumToRender={10}
      contentContainerStyle={styles.list}
      keyExtractor={item =&gt; `${item.id}`}
      renderItem={({ item }) =&gt; }
      ItemSeparatorComponent={() =&gt; }
      style={{ maxHeight: 200 }}
    /&gt;
  );
};

const Hits = connectInfiniteHits(({ hits, hasMore, refine, onPress, currentUser }) =&gt; {
  const data = hits.filter(item =&gt; item.id != currentUser.id);
  return 
});

const InstantSearchBox = connectSearchBox(
  ({ refine, currentRefinement, placeholder, style }) =&gt; (
    
  ));

class Blocking extends React.Component {
  static navigationOptions = ({ navigation }) =&gt; navigationOptions(navigation, 'Blocking');
github algolia / react-instantsearch / examples / react-native / src / Home.js View on Github external
key={`${sectionID}-${rowID}`}
      style={{
        height: adjacentRowHighlighted ? 4 : 1,
        backgroundColor: adjacentRowHighlighted ? '#3B5998' : '#CCCCCC',
      }}
    /&gt;
  );
}

Hits.propTypes = {
  hits: PropTypes.array.isRequired,
  refine: PropTypes.func.isRequired,
  hasMore: PropTypes.bool.isRequired,
};

const ConnectedHits = connectInfiniteHits(Hits);
const ConnectedStats = connectStats(({ nbHits }) =&gt; (
  
));

const ConnectedSortBy = connectSortBy(
  ({ refine, items, currentRefinement }) =&gt; {
    const icon =
      Platform.OS === 'ios' ? (
        
      ) : (
github tech-conferences / confs.tech / src / components / ScrollToConference / ScrollToConference.ts View on Github external
}

    this.setState({scrolled: true}, () => {
      setTimeout(() => {
        location.hash = '';
        location.hash = hash;
      });
    });
  }

  render() {
    return null;
  }
}

export default connectInfiniteHits(ScrollToConference);
github jscoach / client / src / Hits.js View on Github external
searchResults &amp;&amp;
    searchResults.nbHits === 0 &amp;&amp; (
      <div>
        No results have been found for {searchState.query}.
      </div>
    )
);

const Delimiter = connectStateResults(
  ({ index, searchResults }) =&gt;
    (index + 1) % searchResults.hitsPerPage === 0 ? (
      <div data-count="{humanizedNumber(index">
    ) : null
);

const Hits = connectInfiniteHits(({ hits, hasMore, refine }) =&gt; (
  <div>
    

    {hits.map((hit, index) =&gt; [
      ,
      ,
    ])}

    {hasMore &amp;&amp; (
      <button disabled="{!hasMore}">
        Load More
      </button>
    )}
  </div>
));
</div>