I am designing a messenger application on reactnative.
I have my redux store structured like this:
And this is my component which render:
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.
Result:
Expected result:
Rendering only 1 time each MessageItem component (React.memo actually doesn't work, rendering even if propsEqualTo is true)
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.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.