Loading video...
Video Failed to Load
How should you search, filter, and paginate data with Next.js? This demo has 50,000 books in a Postgres database. • Page Load: When the page loads, we see the React Suspense fallback. This loading skeleton is displayed until the first page of books is retrieved from the database. •... show more
236,802 views • 2 years ago •via X (Twitter)
10 Comments

1. Cache results with (redis Alternative) to avoid re-query same data over and over 2. Use to index results for blazing fast filtering and fuzzy searching

If you're trying to avoid re-querying, you can use the built-in React cache() function.

Nice demo Lee! By changing page=-1 in params, it’s throwing some error saying “database does not have a books table”.

You're hired for the QA team 🤣

looks like the `[id]` page cant be found, try to refresh on the page directly

Nice, good catch. Let me fix this.

Here's An example with typesense with 28 millions books:

Nice work Lee. I’m working on a feature that needs this and will look at your implementation for inspiration. I saw that the pagination bar is not showing up on iOS, maybe something with vheight?

Ahhh yes, if you scroll futher it's there. It's the Safari viewport differences, I will fix.

love seeing the examples Lee. it's a huge help.
