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

[@mantine/core] Select: More stable useEffect dependency for search #4998

Merged
merged 1 commit into from Oct 12, 2023

Conversation

DoubleJ-G
Copy link
Contributor

I was tracking down the issue mentioned in #4995 and discovered it was due to multiple renders caused by the useEffect hook.

Often times the data prop isn't a stable reference so using the optionsLockup which is derived from it in a useEffect was causing unnecessary renders.

Instead, I have used the selectedOption in the dependency array which seems to be more stable even when data changes.

@rtivital rtivital merged commit 07d85c5 into mantinedev:master Oct 12, 2023
1 check passed
@rtivital
Copy link
Member

Thanks!

@VugarAhmadov
Copy link

Thanks! works like a charm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants