Answer the question
In order to leave comments, you need to log in
How to make an infinite scroll with automatic content loading (React.js)?
When the component is initialized, I have an ajax request in response, an array with ten objects comes in, for example, there are 10 of them.
And in the following way, in the component, I render the data to the page:
return (
<div className="book">
<table className="highlight">
<thead>
<tr>
<th>Имя</th>
<th>Город</th>
<th>Номер телефона</th>
<th/>
</tr>
</thead>
<tbody>
{
books &&
books.map((book) => {
return (
<tr key={book.pbnum}>
<td>{book.pbfirstName} {book.pblastName}</td>
<td>{book.pbcity}</td>
<td>{book.pbphoneNumber}</td>
<td/>
<td>
<Link
className="waves-effect waves-light btn"
to={`/book/${book._id}/edit?allow=true`}
>Редактировать</Link>
</td>
</tr>
)
})
}
</tbody>
</table>
</div>
)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question