Will using UUID to as list keys cause unnecessary re-renders in React?

后端 未结 2 1504
再見小時候
再見小時候 2021-01-20 22:04

I have a list of items that doesn\'t contain enough data to generate a unique key. If I use the uuid library to generate an ID, will a single item change also causes the oth

2条回答
  •  我在风中等你
    2021-01-20 22:24

    Yes. Keys should be stable. If they're not, React can't infer that these items might be the same at all, and has to fully rerender them.

提交回复
热议问题