L
L
LEV192019-03-31 20:27:40
React
LEV19, 2019-03-31 20:27:40

Loading data with Ajax in React?

For example, I have list.json, where there are 1000 users (First name + Last name)
I need to display the first ones on the screen and so that when the button 'show another 10-20-100' is clicked, data is added, in which direction to dig!??
Thank you)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Anton Spirin, 2019-03-31
@rockon404

Pagination

A
Andrey Okhotnikov, 2019-04-01
@tsepen

Store the limit value in the state - this is the number of records to be loaded and offset - the offset from the beginning of the array.
For example, when loading a component, you load limit records from the offset element. After loading, change offset to offset + limit. And with each loading of elements you repeat this operation

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question