Search code examples
reactjsreact-nativeredux

React.memo prevent rendering redux nested data doesnt work


I am designing a messenger application on reactnative.

I have my redux store structured like this :

store structuration

And this is my component which render :

code component

When an event is added in store with my reducer, all of messages components are rendered each times even if React.memo equalTo return true.

reducer

Result :

result

Expected result :

Rendering only 1 time each MessageItem component (React.memo actually doesn't work, rendering even if propsEqualTo is true)


Solution

  • Ok sorry for that, I just found the solution after 6h research and post here ...

    My React.memo component was rendering everytimes because I used a useSelector in it. I removed and now it's OK.