Function
useMemo
(
nextCreate: () => T,
inputs: Array<mixed> | void | null,
)
Source from the content-addressed store, hash-verified
| 443 | } |
| 444 | |
| 445 | function useMemo<T>( |
| 446 | nextCreate: () => T, |
| 447 | inputs: Array<mixed> | void | null, |
| 448 | ): T { |
| 449 | const hook = nextHook(); |
| 450 | const value = hook !== null ? hook.memoizedState[0] : nextCreate(); |
| 451 | hookLog.push({ |
| 452 | displayName: null, |
| 453 | primitive: 'Memo', |
| 454 | stackError: new Error(), |
| 455 | value, |
| 456 | debugInfo: null, |
| 457 | dispatcherHookName: 'Memo', |
| 458 | }); |
| 459 | return value; |
| 460 | } |
| 461 | |
| 462 | function useSyncExternalStore<T>( |
| 463 | subscribe: (() => void) => () => void, |