0Pricing
Next.js 15 Fullstack (App Router + Server Actions) · Ders

Sunucu Eylemleriyle İyimser Kullanıcı Arayüzü ve Bekleme Durumları

Anında geri bildirim sağlamak için Sunucu Eylemlerini useOptimistic, useFormStatus ve useTransition ile birleştirerek hızlı tepki veren arayüzler oluşturun.

Sunucu Eylemleriyle İyimser Kullanıcı Arayüzü ve Bekleme Durumları, CoddyKit'te ücretsiz bir Next.js 15 Fullstack (App Router + Server Actions) dersidir. Bu, 4 dersinin 4. dersidir. Aşağıdan dersin tamamını ücretsiz okuyabilir, sonra tarayıcıda yerleşik kod editörü ve 7/24 yapay zeka koçu ile uygulamalı olarak pratik yapabilirsin. Bu, Next.js 15 Fullstack (App Router + Server Actions) öğrenme yolunun bir parçasıdır ve ilerlemeniz web ve CoddyKit uygulaması arasında senkronize olur. Next.js 15 Fullstack (App Router + Server Actions) kursu toplamda 4 dersten oluşur.

Bu dersin bazı bölümleri henüz çevrilmemiş olup İngilizce olarak gösterilmektedir.

Why Optimistic UI

Server Actions involve a network round trip. Optimistic UI updates the screen immediately as if the action succeeded, then reconciles with the real result for a fast feel.

Pending State with useFormStatus

The useFormStatus hook reads whether the parent form is submitting, letting you disable buttons or show spinners.

"use client";
import { useFormStatus } from "react-dom";
export function Submit() {
  const { pending } = useFormStatus();
  return <button disabled={pending}>{pending ? "Saving..." : "Save"}</button>;
}

useOptimistic Basics

The useOptimistic hook gives you a temporary optimistic state that overrides the real state until the action resolves.

"use client";
import { useOptimistic } from "react";
const [optimistic, addOptimistic] = useOptimistic(messages, (state, next) => [...state, next]);

Wiring an Optimistic Add

Call addOptimistic before invoking the action so the item appears instantly; the server then revalidates the true list.

async function action(formData) {
  addOptimistic({ text: formData.get("text"), sending: true });
  await sendMessage(formData);
}

useTransition

useTransition marks state updates as non-urgent and exposes isPending, useful when calling a Server Action outside a form.

"use client";
const [isPending, startTransition] = useTransition();
startTransition(() => { void likePost(id); });

Reconciliation

When the action finishes and the data revalidates, React discards the optimistic state and renders the authoritative server data automatically.

Handling Failures

If the action throws, the optimistic update is rolled back. Surface an error so the user knows their change did not persist.

Progressive Enhancement

Forms with Server Actions work even before JS loads. useFormStatus and optimistic hooks layer enhancement on top for interactive clients.

Disabling Double Submits

Use the pending flag to prevent duplicate submissions, which would otherwise fire the Server Action twice.

Keeping Inputs Responsive

Clear or reset the input immediately on optimistic add so the user can keep typing without waiting for the server.

Choosing the Right Hook

Use useFormStatus inside forms for pending UI, useOptimistic for instant list/state updates, and useTransition for non-form action calls.

Quick Check

What does useOptimistic provide?

Recap

You combined Server Actions with useFormStatus for pending UI, useOptimistic for instant updates with automatic reconciliation, and useTransition for non-form calls — rolling back gracefully on failure for a snappy, resilient UX.

Sıkça Sorulan Sorular

“Sunucu Eylemleriyle İyimser Kullanıcı Arayüzü ve Bekleme Durumları” dersi ücretsiz mi?

Evet — “Sunucu Eylemleriyle İyimser Kullanıcı Arayüzü ve Bekleme Durumları” dersin tüm metni burada web'de ücretsiz olarak okunabilir. Etkileşimli olarak pratik yapmak (yerleşik kod editörü ve 7/24 yapay zeka koçu) ve Next.js 15 Fullstack (App Router + Server Actions) kursunun geri kalanını açmak için CoddyKit PRO'ya yükselt. Next.js 15 Fullstack (App Router + Server Actions) kursu toplamda 4 dersten oluşur.

“Sunucu Eylemleriyle İyimser Kullanıcı Arayüzü ve Bekleme Durumları” dersinde ne öğreneceğim?

Anında geri bildirim sağlamak için Sunucu Eylemlerini useOptimistic, useFormStatus ve useTransition ile birleştirerek hızlı tepki veren arayüzler oluşturun. Next.js 15 Fullstack (App Router + Server Actions) ile uygulamalı kodu tarayıcıda doğrudan çalıştırarak pratik yaparsın ve 7/24 yapay zeka koçu dersi çalışırken sorularını yanıtlar.

Next.js 15 Fullstack (App Router + Server Actions) öğrenmeye başlamak için deneyim gerekli mi?

Önceden deneyim gerekmez. CoddyKit'te Next.js 15 Fullstack (App Router + Server Actions), başlangıçtan ileri seviyeye kadar yapılandırıldığı için buradan başlayabilir veya başından başlayıp kendi hızında ilerleme yapabilirsin. Bu, 4 dersinin 4. dersidir.

“Sunucu Eylemleriyle İyimser Kullanıcı Arayüzü ve Bekleme Durumları” dersi ne kadar sürer?

Çoğu CoddyKit dersi yaklaşık 5–10 dakika sürer. Her biri kısa ve etkileşimli olduğu için sabit ilerleme yaparsın ve web ile uygulama arasında tam olarak bıraktığın yerden devam edebilirsin.

Bu Next.js 15 Fullstack (App Router + Server Actions) dersinde kod yazıp çalıştırabilir miyim?

Evet. Her Next.js 15 Fullstack (App Router + Server Actions) dersi yerleşik bir kod editörü içerir, bu sayede tarayıcıda gerçek kod yazıp çalıştırabilir ve anlık yapay zeka geri bildirimi alırsın — yerel kurulum gerekli değildir.

Bu kursun tüm dersleri

  1. Temel Sunucu Eylemi Formları
  2. Verileri Değiştirme ve Yeniden Doğrulama
  3. Eylemlerde Hata İşleme
  4. Sunucu Eylemleriyle İyimser Kullanıcı Arayüzü ve Bekleme Durumları
← Next.js 15 Fullstack (App Router + Server Actions) Sayfasına Dön