For inifite scroll you could use an Axios request in your Vue/React template that fetches the data on the current page. Use js to detect when the user has reached the bottom of the element then make a call to the back end to fetch the data and update the current data.
May 30, 2024
5
Level 4
Inertia, Infinite Scroll - API or Web Routes?
If i'm using Inertia like this:
This is a web route:
public function index()
{
return Inertia::render('Posts/Index', [
'posts' => Post::cursorPaginate(20),
]);
}
But on that page have infinite scroll, should the infinite scroll script call an API route for subsequent data?
Please or to participate in this conversation.