0

我正在创建一个类似于 netflix 的应用程序。我有以下用例:

movies.map((movie) => (
   <Grid item key={movie.imdbID}>
      <Card movie={movie} onIconClick={onIconClick} />
   </Grid>
))

I'm wrapping Card component under React.memo but even when one of the movie (watched flag inside it) changes, all the Cards get rendered.
Somehow Card is not getting memoized.
What I might be doing wrong?

当用户仅单击一张卡并且只需要更新该卡时,如何防止重新渲染所有电影?

4

0 回答 0