React: Parent component re-renders all children, even those that haven't changed on state change

后端 未结 4 1965
野性不改
野性不改 2020-11-30 03:33

I haven\'t been able to find a clear answer to this, hope this isn\'t repetitive.

I am using React + Redux for a simple chat app. The app is comprised of an InputBar

4条回答
  •  鱼传尺愫
    2020-11-30 04:04

    If you're using map to render child components and using a unique key on them (something like uuid()), maybe switch back to using the i from the map as key. It might solve the re-rendering issue.

    Not sure about this approach, but sometimes it fixes the issue

提交回复
热议问题