Video wird geladen...
Video konnte nicht geladen werden
after() in Nextjs
48,270 Aufrufe • vor 1 Jahr •via X (Twitter)
9 Kommentare

Alex Sidorenkovor 1 Jahr
Docs

Alfonvor 1 Jahr
Wait whats the difference between after() and waitUntil() ?

Dominik Ferbervor 1 Jahr
Your clips are so good! Small heads up around this example: Next.js might prefetch pages so you would end up logging views for pages the user never actually visited

Alex Sidorenkovor 1 Jahr
Good call, thanks. In a real-world scenario, you'll likely have a loading.tsx or Suspense, and Links only prefetch the page up to the Suspense boundary.

Mubashirvor 1 Jahr
amazing, is this api stable?

Alex Sidorenkovor 1 Jahr
Yes, since 15.1

Stephen Raynervor 1 Jahr
Can this be used more than once the same response?

Alex Sidorenkovor 1 Jahr
Just checked this by adding a ChildComponent that also logs to another hook using after(). Both work.

Edgarasvor 1 Jahr
This could actually be nice for SOME background job use cases.



