Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure props of type PlainSearchParameters instead of SearchParameters (react-instantsearch) #6297

Closed
1 task done
natedx opened this issue Jul 24, 2024 · 3 comments
Closed
1 task done
Labels
triage Issues to be categorized by the team

Comments

@natedx
Copy link

natedx commented Jul 24, 2024

🐛 Current behavior

In version 7.12.2 or react-instantsearch, I get this TypeError when adding a Configure component to my app :
Type '{ hitsPerPage: number; insideBoundingBox: string; }' is not assignable to type 'IntrinsicAttributes & PlainSearchParameters'.

In connectors/configure/connectConfigure.d.ts, you have :

export type ConfigureConnectorParams = {
    /**
     * A list of [search parameters](https://www.algolia.com/doc/api-reference/search-api-parameters/)
     * to enable when the widget mounts.
     */
    searchParameters: PlainSearchParameters; // <--- shouldn't this be SearchParameters ?
};

🔍 Steps to reproduce

  1. Open the react Instant Search CodeSandBox template, then install dependencies
  2. Go to the Configure component in App.tsx
  3. Notice that hitsPerPage doesn't appear in autocomplete

Live reproduction

https://codesandbox.io/p/sandbox/github/algolia/instantsearch/tree/templates/react-instantsearch

💭 Expected behavior

Configure props should work as advertised in the documentation : https://www.algolia.com/doc/api-reference/widgets/configure/react/#props

Package version

react-instantsearch 7.12.2

Operating system

any

Browser

all

Code of Conduct

  • I agree to follow this project's Code of Conduct
@natedx natedx added the triage Issues to be categorized by the team label Jul 24, 2024
@Haroenv
Copy link
Contributor

Haroenv commented Jul 24, 2024

The sandbox you linked shows that configure is working fine (no typescript error). I recognise this behaviour from a previously fixed bug (see #5658), but that's merged and released. I wonder if you somehow ended up with a stale dependency of algoliasearch-helper somewhere? Can you reproduce this in a blank example?

@natedx
Copy link
Author

natedx commented Jul 25, 2024

You are correct. My mistake, I must have had a stale dependency somewhere.

@natedx natedx closed this as completed Jul 25, 2024
@Haroenv
Copy link
Contributor

Haroenv commented Jul 25, 2024

Glad you have a solution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage Issues to be categorized by the team
Projects
None yet
Development

No branches or pull requests

2 participants