Loading video...

Video Failed to Load

Go Home

Server-side search with Next.js 13 and server components

208,536 views • 2 years ago •via X (Twitter)

10 Comments

Alex Sidorenko's profile picture
Alex Sidorenko2 years ago

Adding debounce to stop fetching on every keystroke

JLarky's profile picture
JLarky2 years ago

Why do we have fetch on the server if we are already on the server?

Alex Sidorenko's profile picture
Alex Sidorenko2 years ago

External api. I reduced api string a bit too much for the animation (for all code to fit in) which indeed makes it confusing.

Alex Sidorenko's profile picture
Alex Sidorenko2 years ago

The actual API is external. Shortened it for the animation to fit in.

Onur Şuyalçınkaya's profile picture
Onur Şuyalçınkaya2 years ago

the only downside of this is that using `searchParams` will opt the page into dynamic rendering at the request time

Coding in Flow's profile picture
Coding in Flow2 years ago

Now you can also use form + server action + redirect and keep it a server component.

Fredkisss is on 🦋 blue sky 🦋's profile picture
Fredkisss is on 🦋 blue sky 🦋2 years ago

It’s better to wrap the input in a form and calling router.push() onSubmit on the form and call form.requestSubmit() when the input changes, So that using it can be progressively enhanced and work with/without JS

Malte Ubl's profile picture
Malte Ubl2 years ago

I love the format! Awesome work!

Zain Zafar's profile picture
Zain Zafar2 years ago

cool stuff I have 2 unrelated questions: 1. How did you create this animation? 2. Which theme is it?

Alex Sidorenko's profile picture
Alex Sidorenko2 years ago

I make animations with Apple Keynote Theme - Monokai

Related Videos