Suspense
Suspense (التعليق)
GLS-000088
Definition
A React feature that shows a loading fallback while waiting for async data or lazy-loaded components.
ميزة React تعرض بديلًا للتحميل أثناء الانتظار على بيانات غير متزامنة أو مكونات تُحمَّل كسولًا.
Why It Matters
Suspense prevents blank screens while data loads. The loading.tsx files in 404Fault use Suspense to show skeletons during page transitions.
Suspense يمنع الشاشات الفارغة أثناء تحميل البيانات. ملفات loading.tsx في 404Fault تستخدم Suspense لإظهار هياكل أثناء انتقالات الصفحة.
Full Definition
Example Usage
“<Suspense fallback={<GlossaryTermSkeleton />}><GlossaryTermPage slug={slug} /></Suspense> shows a skeleton while the term data fetches.”
“<Suspense fallback={<GlossaryTermSkeleton />}><GlossaryTermPage slug={slug} /></Suspense> يُظهر هيكلًا أثناء جلب بيانات المصطلح.”
AI Builder Tips
Avoid these mistakes when using Suspense:
Wrapping the wrong component in Suspense
Not providing a meaningful fallback — a blank div is not helpful to users
Sign in to unlock guided AI explanations from AI Teacher.
Generate a Prompt
Copy this prompt and use it directly with any AI model — no setup needed.
Help me build a project using Suspense. Explain: 1. What is Suspense and why it matters 2. The core architecture and required tools 3. Step-by-step implementation plan 4. Common mistakes to avoid: Wrapping the wrong component in Suspense, Not providing a meaningful fallback — a blank div is not helpful to users 5. Best practices and production tips