-
Notifications
You must be signed in to change notification settings - Fork 224
Closed
algolia/instantsearch
#6354Labels
Description
Description
on latest versions:
"react-instantsearch": "7.13.0"
"algoliasearch": "5.3.0"
when setting SearchClient on InstantSearch as prop, compiler complains that searchForFacetValues is wrong
example:
import {InstantSearch} from "react-instantsearch";
import {SearchClient, algoliasearch} from "algoliasearch";
const searchClient: SearchClient = algoliasearch('appId', 'apiKey')
<InstantSearch
indexName="indexName"
searchClient={searchClient} // <--- compiler complains that face
/>
Repo with reproduction: https://github.com/WavyWalk/reproduce-algolia-v5/blob/typing-5-3-0/src/App.tsx
Client
Search
Version
5.3.0
Relevant log output
TS2322: Type
{ transporter: Transporter; appId: string; clearCache(): Promise<void>; readonly _ua: string; addAlgoliaAgent(segment: string, version?: string | undefined): void; ... 76 more ...; updateApiKey({key, apiKey}: UpdateApiKeyProps, requestOptions?: RequestOptions | undefined): Promise<...>; }
is not assignable to type SearchClient
Types of property searchForFacetValues are incompatible.
Type
({indexName, facetName, searchForFacetValuesRequest}: SearchForFacetValuesProps, requestOptions?: RequestOptions | undefined) => Promise<SearchForFacetValuesResponse>
is not assignable to type undefined