Complete the code to wrap the component with React.memo.
const MemoizedComponent = [1](MyComponent);React.memo is used to wrap a component to memoize it and avoid unnecessary re-renders.
Complete the code to export the memoized component as default.
export default [1](MyComponent);Exporting the component wrapped in React.memo ensures it is memoized when imported elsewhere.
Fix the error in the code to correctly memoize the component.
const MyComponent = (props) => { return <div>{props.text}</div>; };
const MemoComp = React.[1](MyComponent);The correct React API is React.memo. Other options are invalid or different hooks.
Fill both blanks to create a memoized component with a custom comparison function.
const MemoComp = React.memo(MyComponent, [1]); function [2](prevProps, nextProps) { return prevProps.value === nextProps.value; }
The custom comparison function is passed as the second argument to React.memo. Naming it areEqual is common and matches usage.
Fill all three blanks to memoize a component and export it with a custom comparison function.
function [1](prev, next) { return prev.count === next.count; } const MemoComp = React.[2](Counter, [3]); export default MemoComp;
useMemo instead of memoThe function areEqual is the custom comparison passed to React.memo to memoize the component with custom logic.