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

GlobalSearch renders unnecessarily when not empty #3060

Open
taneliang opened this issue Dec 18, 2020 · 0 comments · May be fixed by #3155
Open

GlobalSearch renders unnecessarily when not empty #3060

taneliang opened this issue Dec 18, 2020 · 0 comments · May be fixed by #3155

Comments

@taneliang
Copy link
Member

Describe the bug

A clear and concise description of what the bug is.

To Reproduce

Steps to reproduce the behavior:

  1. Start NUSMods locally (you can't use nusmods.com as we need a development copy of React).

  2. Type something into global search.

  3. Begin recording a profile in the React Profiler (Chrome version here).

  4. Do something unrelated to global search, e.g. go to http://localhost:8080/contribute and click the Show More button in the Map the School section.

  5. Stop the recording.

  6. Notice GlobalSearch rendered:
    image

  7. Reload the page, and record another profile without entering anything into global search. Notice that GlobalSearch did not render and that there were fewer renders:
    image

Expected behavior

GlobalSearch should not render unnecessarily.

Additional context

It may be easier to fix this after #3039 is merged, so that we can use the React scheduling profiler to see if there are any unexpected state updates.

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

Successfully merging a pull request may close this issue.

1 participant