Skip to content

Commit db73b8d

Browse files
authored
chore: add useMemo back (#215)
1 parent afc4b67 commit db73b8d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/hooks/useGlobalCache.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,16 @@ export default function useGlobalCache<CacheType>(
4848
});
4949
};
5050

51+
// Create cache
52+
React.useMemo(
53+
() => {
54+
buildCache();
55+
},
56+
/* eslint-disable react-hooks/exhaustive-deps */
57+
[fullPathStr],
58+
/* eslint-enable */
59+
);
60+
5161
let cacheEntity = globalCache.opGet(fullPathStr);
5262

5363
// HMR clean the cache but not trigger `useMemo` again

0 commit comments

Comments
 (0)