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

Unnecessary Re-renders in SearchBox Component #53

Open
pawansoni007 opened this issue Oct 6, 2024 · 6 comments
Open

Unnecessary Re-renders in SearchBox Component #53

pawansoni007 opened this issue Oct 6, 2024 · 6 comments

Comments

@pawansoni007
Copy link

Issue Description

The SearchBox component in our application is re-rendering every second due to a timer in its parent component (Playground), even when the search state hasn't changed. This may lead to performance issues, especially with larger datasets or more complex rendering logic.

Current Behavior

  1. The usePlayground hook in Playground sets up a timer that updates timeLeft every second.
  2. This causes Playground to re-render every second.
  3. Consequently, SearchBox re-renders every second, despite its props (search and setSearch) not changing.

Expected Behavior

SearchBox should only re-render when its props (search or setSearch) actually change, not on every tick of the parent component's timer.

@pawansoni007
Copy link
Author

#54

@sahadat-sk
Copy link

Hey @pawansoni007 can i work on this issue?

@pawansoni007
Copy link
Author

@sahadat-sk no, it's already an ongoing change from my end.

@lucifercr07
Copy link
Contributor

@pawansoni007 can you please check once if this has been fixed in latest build?

@pawansoni007
Copy link
Author

Sure I'll check and raise another PR with requested changes.

@progmatic-99
Copy link

@lucifercr07 can i take this up?

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

No branches or pull requests

4 participants