How to look under the hood of useMemo and useCallback?

I want to see how useMemo and useCallback hooks works inside for my research purposes. Like how they work under the hood. How can I?

I tried to go inside main React file but all I found was just a namespace declaration for these hooks