Questions tagged [react-instantsearch]

react-instantsearch related technical questions.

For Algolia react-instantsearch library issues and questions. For non-programming related questions or general discussion about Algolia or instantsearch.js, please post your question on discourse.algolia.com instead. You can expect a prompt, friendly reply from our team or community.

Find the documentation at community.algolia.com/react-instantsearch, and the source at github.com/algolia/react-instantsearch.

75 questions
4
votes
1 answer

this.props.contextValue.store.getState is not a function when adding a custom input

I'm running into an issue with adding my own custon input after following the documentation for Autocomplete. The error I get is "this.props.contextValue.store.getState is not a function" when adding my CustomSearchBox component. Can anyone advise…
mark
  • 235
  • 3
  • 11
4
votes
0 answers

How to set a default filter option in Algolia Instant Search

I want to display only certain records from Algolia.For that I need to filter the list with some Ids (which I will get from some other api).The records has to displayed on page load .Is there any option I can use to filter the list that dont reflect…
4
votes
1 answer

How to manually clear the cache of my algolia index?

I'm using the algolia client directly in my node js backend so i don't use instantsearch.js. I can easily querying/indexing/updating etc. my algolia index but i can't find a way to clear the cache because my app always need to display an updated…
John doe
  • 3,680
  • 7
  • 31
  • 65
3
votes
0 answers

Multiple HierarchicalMenu with same facets param in the one page but different window size

We have two Filter components that use connectHierarchicalMenu() on one page. We would like to render one of them on bigger devices like desktops and one for tablets & mobile devices. Expected behavior: Users must able to open the page in desktop…
Siavash
  • 2,813
  • 4
  • 29
  • 42
3
votes
2 answers

How to update my instantsearch hits list whithout remounting my component?

I need to refresh frequently my hits because new item are added very often. So that it will avoid me to wait until my component be refreshed or mounted again before see the updated results list. But i have no idea about how to do so. export const…
John doe
  • 3,680
  • 7
  • 31
  • 65
3
votes
1 answer

React InstantSearch RefinementList transformItems not working

So I have successfully implemented the React InstantSearch library in my app, and am trying to apply a filter to the refinement list (to ensure the filters that show up are relevant to the active user, and hide the ones that aren't). I have tried…
Jbbae
  • 824
  • 9
  • 19
2
votes
1 answer

NextJS React Prerendering issue with Algolia connectSearchBox

I'm working with Algolia instant search for react, and I'm using a custom SearchBox component which I've written like so: import { connectSearchBox } from "react-instantsearch-dom"; import InputText from "components/common/InputText"; interface…
rstojano
  • 159
  • 4
  • 14
2
votes
0 answers

Algolia Infiniti scroll is not working in React Native Hooks

I need to implement the Algolia search filter in a react native .All Filters, sorts are working, but infinite scroll is not working .I am using FlatList to load the list . Below is the code used import { InstantSearch, connectInfiniteHits, }…
Janaki Narayanan
  • 523
  • 6
  • 24
2
votes
1 answer

React InstantSearch- How do you hide "hits" from the screen until the searchBox is used?

I'm using React InstantSearch in Algolia and i'm trying to get it hide its "hits" component by default and only show up when its time to use and click on the searchBox. I started my research here:…
2
votes
1 answer

How to type custom widget for Algolia React instant search?

I'm trying to correctly type my connected list of Hits from algolia instant search. My custom Hits component: type Props = { hits: User[]; onSelectUser: (user: User) => void }; const SearchResults: React.FC = ({ hits, onSelectUser }) => { …
rvwsd
  • 97
  • 11
2
votes
1 answer

Algolia: Reset of refinement when opening a drawer

I'm developing my marketplace with Algolia and I'm using this example as support. https://react-instantsearch.netlify.app/examples/e-commerce/ On mobile mode the filters are visible thanks to a drawer. On my app I made customs UI for every widget.…
2
votes
0 answers

How do I preserve previous state of React InstantSearch

import React, { Component, useState } from 'react'; import algoliasearch from 'algoliasearch/lite'; import { InstantSearch, Hits, SearchBox, Highlight, connectRefinementList, } from 'react-instantsearch-dom'; import PropTypes from…
2
votes
1 answer

Filter by two items react-instantsearch

I am sure this is probably a beginner issue but, I am trying to filter by both ongoing and all_day. How can this be achieved in the same .filter()? items.filter(item => item.attribute !== 'ongoing',…
brooksrelyt
  • 3,925
  • 5
  • 31
  • 54
2
votes
1 answer

onChange and setState don't work together in my code

I am trying to build a search box. However, when I want to set the state when something is typed in, the box just simply doesn't let me type in anything. This is the class which calls the component of search box export default class Tagsearch…
Liu Hantao
  • 620
  • 1
  • 9
  • 19
2
votes
2 answers

Clicking a link when enter key is pressed using React

I have been searching SO for a while so this should not be a duplicate. But, I am trying to trigger a link click when the enter key is pressed. This is what I am working with: handleKeyPress(target) { if(target.charCode==13){ alert('Enter…
brooksrelyt
  • 3,925
  • 5
  • 31
  • 54
1
2 3 4 5