📜  如何使用反应备忘录挂钩 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:22.245000             🧑  作者: Mango

代码示例2
function moviePropsAreEqual(prevMovie, nextMovie) {
  return prevMovie.title === nextMovie.title
    && prevMovie.releaseDate === nextMovie.releaseDate;
}

const MemoizedMovie2 = React.memo(Movie, moviePropsAreEqual);