mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
DevTools: Show hook names based on variable usage (#21641)
Co-authored-by: Brian Vaughn <brian.david.vaughn@gmail.com> Co-authored-by: Saphal Patro <saphal1998@gmail.com> Co-authored-by: VibhorCodecianGupta <vibhordelgupta@gmail.com>
This commit is contained in:
co-authored by
Brian Vaughn
Saphal Patro
VibhorCodecianGupta
parent
ab390c65ee
commit
c5cfa71948
+5
-1
@@ -47,13 +47,17 @@ import {
|
||||
} from 'react-devtools-shared/src/types';
|
||||
import {localStorageGetItem, localStorageSetItem} from './storage';
|
||||
import {meta} from './hydration';
|
||||
|
||||
import type {ComponentFilter, ElementType} from './types';
|
||||
import type {LRUCache} from 'react-devtools-shared/src/types';
|
||||
|
||||
const cachedDisplayNames: WeakMap<Function, string> = new WeakMap();
|
||||
|
||||
// On large trees, encoding takes significant time.
|
||||
// Try to reuse the already encoded strings.
|
||||
const encodedStringCache = new LRU({max: 1000});
|
||||
const encodedStringCache: LRUCache<string, Array<number>> = new LRU({
|
||||
max: 1000,
|
||||
});
|
||||
|
||||
export function alphaSortKeys(
|
||||
a: string | number | Symbol,
|
||||
|
||||
Reference in New Issue
Block a user