near / near-discovery-components

This is a repository that holds the source code of all NEAR discovery components that the team maintains for near.org.
https://near.org
MIT License
14 stars 12 forks source link

Refactor `IndexFeed` component #790

Closed shelegdmitriy closed 2 months ago

shelegdmitriy commented 4 months ago

Describe the bug There is an issue with limits and loading data at IndexFeed component. It is constantly updated until it reaches the limit of 100 entries. Passing limit, or initialRenderLimit doesn't change anything. But if you use this in manual mode (without infinite scroll) then works well.

To Reproduce Steps to reproduce the behavior:

  1. Start this project locally as described here
  2. Open this component and make sure you're loading the v1.Posts component there
  3. Open home page in the browser.

You can go both ways:

  1. Open the network tab and pay attention at the amount of queries.
  2. Open IndexFeed component and try to add console.log("items: ", items) on this line. Then reload a page and pay attention at you console

Expected behavior IndexFeed component should load data according to limit and do not re-render without a reason.

Additional context Related issue https://github.com/near/near-discovery/issues/1012