Tech TutorBangla Web Documentation
Portfolio
HomeHTMLCSSTailwind CSSJavaScriptTypeScriptReactNext.jsNode.jsExpressSocket.IOExpoWordPressPostgreSQLPrismaPostgresNestJSMongoDBDockerTanStackTanStack TableRTK QueryGitGitHub
  • RTK Query Documentation39টি অধ্যায়
প্রযুক্তি নির্বাচন
HomeHTMLCSSTailwind CSSJavaScriptTypeScriptReactNext.jsNode.jsExpressSocket.IOExpoWordPressPostgreSQLPrismaPostgresNestJSMongoDBDockerTanStackTanStack TableRTK QueryGitGitHub
  • Redux Intro
  • Architecture
  • Redux Toolkit
  • Project Setup
  • Folder Structure
  • configureStore
  • Redux Provider
  • createSlice
  • Reducers & Actions
  • Typed Hooks
  • Selectors
  • Devtools
  • RTK Query
  • createApi
  • API Middleware
  • API Tags
  • Fetch List
  • Fetch Detail
  • Mutation — Create
  • Mutation CRUD
  • Cache Invalidation
  • Cache Lifecycle
  • Polling
  • Query Selectors
  • Optimistic Update
  • Cart Slice Full
  • Cart UI
  • Local vs Server
  • Listener Middleware
  • Error Handling
  • Loading States
  • Serializability
  • SSR Prefetch
  • Complete Flow
  • Complete Project
  • Production
  • Common Mistakes
  • Best Practices
  • Interview Q&A
  1. Docs
  2. RTK Query
  3. Loading States — Skeleton ও UI
RTK QueryBeginner

Loading States — Skeleton ও UI

Query loading, mutation pending, refetching-এর visual — বাংলায়।

4টি অংশবাংলা ভাষায়
কম্বো state একসাথেtsx
tsx
"use client";

export function ProductsView() {
  const {
    data,
    isLoading,
    isFetching,
    isUninitialized,
    refetch,
  } = useGetProductsQuery();

  // loading overlay for background refetch
  return (
    <div className="relative">
      {isLoading || isUninitialized ? (
        <ProductGridSkeleton />
      ) : (
        <ProductGrid products={data ?? []} />
      )}

      {/* background refetch-এ ছোটো বার */}
      {isFetching && !isLoading && (
        <div className="absolute right-2 top-2">
          <RefreshCw className="size-4 animate-spin text-muted-foreground" />
        </div>
      )}
    </div>
  );
}

Mutation pending

button disabledtsx
tsx
const [createOrder, { isLoading }] = useCreateOrderMutation();

<Button disabled={isLoading || items.length === 0}>
  {isLoading ? "অর্ডার হচ্ছে…" : "চেকআউট"}
</Button>
optimistic-এ loading-নয়

optimistic update-এর সময় isFetching সত্য কিন্তু UI আগেই বদলেছে — সেখানে বড় loading block দেবেন না; ছোটো subtle indicator-only।

শেষ প্যারায় নিজে practice করুন — কোড কপি করে নিজের এডিটরে চালিয়ে দেখুন।
আগেরError Handling — RTK Query ভুলপরেরSerializable State — Gotchas
এই পেজে
Tech Tutor

বাংলায় ওয়েব ডেভেলপমেন্ট ডকুমেন্টেশন শিখুন — ধাপে ধাপে।

Homeসব ডকুমেন্টেশনQuick Startআমার নোটস

© 2026 Tech Tutor. বাংলায় শিখুন, বাংলায় গড়ুন।

mdanamolhasan1998@gmail.com