React@v19源码解析---useMemo/useCallback
useMemo
很简单,直接看源码
mountMemo / updateMemo
function mountMemo(
nextCreate: () => T,
deps: Array | void | null
): T {
// 创建hook对象
const hook = mountWorkInProgressHook();
const nextDeps = deps === undefined ? null : deps;
const nextValue = nextCreate();
hook.memoizedState = [nex