fix: register command re-rendering (#4476)

This commit is contained in:
Peng Xiao authored and GitHub committed 2023-09-25 02:40:53 +00:00
1 parent 5f7f5b74ca
commit dc6b66c32f
1 file changed
+15 -3
+15 -3
View File
@@ -1,5 +1,5 @@
import type { WorkspaceSubPath } from '@affine/env/workspace';
import { useCallback } from 'react';
import { useCallback, useMemo } from 'react';
import {
type NavigateOptions,
useLocation,
@@ -103,7 +103,8 @@ export function useNavigateHelper() {
[navigate]
);
return {
return useMemo(
() => ({
jumpToPage,
jumpToPublicWorkspacePage,
jumpToSubPath,
@@ -112,5 +113,16 @@ export function useNavigateHelper() {
openPage,
jumpToExpired,
jumpToSignIn,
};
}),
[
jumpTo404,
jumpToExpired,
jumpToIndex,
jumpToPage,
jumpToPublicWorkspacePage,
jumpToSignIn,
jumpToSubPath,
openPage,
]
);
}