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

DevTool: hook names cache no longer loses entries between selection #21831

Merged
merged 1 commit into from
Jul 8, 2021

Commits on Jul 8, 2021

  1. DevTool: hook names cache no longer loses entries between selection

    Made several changes to the hooks name cache to avoid losing cached data between selected elements:
    1. No longer use React-managed cache. This had the unfortunate side effect of the inspected element cache also clearing the hook names cache. For now, instead, a module-level WeakMap cache is used. This isn't great but we can revisit it later.
    2. Hooks are no longer the cache keys (since hook objects get recreated between element inspections). Instead a hook key string made of fileName + line number + column number is used.
    3. If hook names have already been loaded for a component, skip showing the load button and just show the hook names by default when selecting the component.
    Brian Vaughn committed Jul 8, 2021
    Configuration menu
    Copy the full SHA
    fa50a4b View commit details
    Browse the repository at this point in the history