阅读背景:

React正在重新渲染我的列表,即使数组中的每个子节点都有其唯一键

来源:互联网 

So, as far as I understand react only rerenders new elements with new keys. Thats not working for me though. I have a list of posts, that are limited to 3. When the user scrolls to bottom of page I add 3 to the limit, which means at the bottom of the page 3 older posts are supposed to be shown. What I have now works, but the entire list is being rerendered. And it jumps to the top which is also not wanted (this I can fix though, main problem is the rerendering). They all have unique keys. How can I prevent this behaviour?So, as far as I understand react only rerenders




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: