export default function memo<Props>( type: React$ElementType, compare?: (oldProps: Props, newProps: Props) => boolean,) { // 根据传入的比较函数来决定是否 rerender return { $$typeof: REACT_MEMO_TYPE, type, compare: compare === undefined ? null : compare, };}