Signed-off-by: Innei <tukon479@gmail.com>
This commit is contained in:
Innei
2025-05-25 14:48:09 +08:00
parent 5d8c652b60
commit a225ac475b
2 changed files with 3 additions and 8 deletions
+1 -7
View File
@@ -1,11 +1,5 @@
# What's new in vNEXT_VERSION
## Shiny new things
## Improvements
## No longer broken
## Thanks
Special thanks to external contributors @ for their valuable contributions
Performance: Fix context menu re-render loop.
@@ -32,10 +32,11 @@ export const useGlobalFocusableScope = () => {
}
export const useGlobalFocusableHasScope = (scope: string) => {
return useGlobalFocusableScopeSelector((v) => v.has(scope))
return useGlobalFocusableScopeSelector(useCallback((v) => v.has(scope), [scope]))
}
export const useGlobalFocusableScopeSelector = (selector: (scope: Set<string>) => boolean) => {
const ctx = use(GlobalFocusableContext)
return useAtomValue(useMemo(() => selectAtom(ctx, selector), [ctx, selector]))
}