appbaseio / reactivesearch

Search UI components for React and Vue
https://opensource.appbase.io/reactivesearch
Apache License 2.0
4.89k stars 468 forks source link

MultiList re-renders several times instead of once #1974

Closed mirjan-hoffmann closed 2 years ago

mirjan-hoffmann commented 2 years ago

Affected Projects React

Library Version: x.y.z from 3.25.1 (also in current version 3.31.0)

Describe the bug When a MultiList component is updated via react-property (e.g. to update the document-counter), the component is re-rendered very often. This affects performance significantly.

To Reproduce https://codesandbox.io/s/crazy-sinoussi-3j9mbd?file=/src/index.js Steps to reproduce the behavior:

Expected behavior Re-render the MultiList component only once, like in version 3.25.0

Same codesandbox like above, just with decreased reactivesearch version to 3.25.0: https://codesandbox.io/s/blissful-goldberg-6x1wvz?file=/src/index.js

Screenshots reactivesearch_multiple_rerender

Desktop (please complete the following information):

Smartphone (please complete the following information): N/A

Additional context N/A

ubaranzorlu commented 2 years ago

Any updates on that one? It seems like the PR doesn't actually solve the problem for me. MultiList renders so much that it always maxes the bars in React Profiler and crashes my app. 3.25.0 seems a more reliable version for MultiList.

ubaranzorlu commented 2 years ago

Using those versions as dependencies solved all my problems.

{ "dependencies": { "@appbaseio/reactivecore": "9.14.10", "@appbaseio/reactivesearch": "3.25.0" } }

bietkul commented 2 years ago

Hello @ubaranzorlu, can you try upgrading to latest version?

mirjan-hoffmann commented 2 years ago

Upgraded to "@appbaseio/reactivesearch": "3.34.1" - performance looks good with this one. Also, my sandbox-example just logs a single re-rendering: https://codesandbox.io/s/xenodochial-bhaskara-wvjhfm

-> fixed from my point of view

ubaranzorlu commented 2 years ago

Hello @ubaranzorlu, can you try upgrading to latest version?

Issue is resolved, thanks 👍