React rerenders the DOM when state changes. To implement an infinite scroll or load more feature, you simply need to update the state. This can be done by sending an AJAX request to your API end point and appending the returned data to the list of items you keep in the state.
Your API needs to know what data to return, so I'd recommend adding offset and limit query parameters that your API uses for retrieving data. Then whenever you scroll to a certain position or press the 'load more'-button, you send the AJAX request and update the offset to be used in a future API call.
Stephan de Vries
Full stack developer, enthusiastic about new technologies.
Thanks for the invite Syed Fazle Rahman !
React rerenders the DOM when state changes. To implement an infinite scroll or load more feature, you simply need to update the state. This can be done by sending an AJAX request to your API end point and appending the returned data to the list of items you keep in the state.
Your API needs to know what data to return, so I'd recommend adding offset and limit query parameters that your API uses for retrieving data. Then whenever you scroll to a certain position or press the 'load more'-button, you send the AJAX request and update the offset to be used in a future API call.
I hope that answers your question.