meilisearch / meilisearch-js-plugins

The search client to use Meilisearch with InstantSearch.
https://www.meilisearch.com
MIT License
461 stars 55 forks source link

Infinite loop error when using the transformItems prop from InstantSearch's Menu component #1292

Open willlee17 opened 5 months ago

willlee17 commented 5 months ago

Description Hello!

I have a simple search app using Gatsby, Meilisearch, and Instantsearch. I'm using Meilisearch Cloud as well. Search and all that works great. I wanted to fine tune the result being shown in the UI when filtering. InstantSearch's docs referred me to use transformItems within the Menu component I'm using (make sure you're on InstantSearch v7 when clicking the url).

Any time I add the prop, I run into an infinite loop. Even when I'm just returning the initial results with no mutations.

<Menu attribute="optionTypes.optionValues.presentation" transformItems={(items) => { console.log("items: ", items); return items; }} />

Any insights?

Packages used: "react-instantsearch": "^7.5.3", "@meilisearch/instant-meilisearch": "^0.13.6", "gatsby-plugin-meilisearch": "^0.3.1",

If applicable, add screenshots or logs to help explain your problem.

Environment (please complete the following information):

curquiza commented 4 months ago

Hello @willlee17 sorry for the daly, do you have the same issue with the latest version of instant-meilisearch? https://github.com/meilisearch/meilisearch-js-plugins/releases