Skip to content

InstantMeiliSearchInstance is not assignable to type 'SearchClient | CompositionClient' #1377

Description

@Strift

Summary

The instantsearch client (@meilisearch/instant-meilisearch) typing is incompatible with the latest release of instantsearch.

Context

Description

The types expected by the latest versions of react-instantsearch and the client returned by @meilisearch/instant-meilisearch and meilisearch do not match.

Versions used:

const { searchClient } = instantMeiliSearch('url', 'apiKey')
return (
  <InstantSearch indexName="index" searchClient={searchClient}>
)

Current behavior

Since the new update of the library, a type error occurs when passing the search client returned by instant-meilisearch to the InstantSearch component.

Error:
Type 'InstantMeiliSearchInstance' is not assignable to type 'SearchClient | CompositionClient'.

(The searchClient prop expects a SearchClient | CompositionClient type)

Expected behavior

No error should occur.

Environment (please complete the following information):

  • "meilisearch": "^0.48.2",
  • "@meilisearch/instant-meilisearch": "^0.24.0",
  • "react-instantsearch": "^7.15.3",

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions