Frontend with React and Next.js
If you know how a React component gets its data, keeps its state, and becomes clickable, you know where its bugs hide. This page builds a tiny shop in Next.js and tests it with Playwright.
7 min read7 মিনিটে পড়া যায় · 7 sections7টি সেকশন · 13 sources13টি সোর্স · updated Nov 2026আপডেট: Nov 2026
From server HTML to a live buttonসার্ভারের HTML থেকে চালু বাটন
Watch a page render on the server, arrive as HTML, then hydrate into a working button. Switch the counter between Server and use client.দেখুন একটা পেজ সার্ভারে রেন্ডার হয়, HTML হয়ে আসে, তারপর hydrate হয়ে কাজ করা বাটন হয়। কাউন্টারটা Server আর use client-এর মধ্যে বদলান।
You’ll learnআপনি শিখবেন
- Pages render on the server by defaultপেজ ডিফল্টভাবে সার্ভারে রেন্ডার হয়✓
- Why the first HTML is staticপ্রথম HTML কেন স্থির
- What use client adds to the bundleuse client বান্ডলে কী যোগ করে
- What hydration doesHydration কী করে
- Why secrets stay on the serverSecret কেন সার্ভারে থাকে
What it is
React lets you combine markup, CSS, and JavaScript into components: reusable UI elements Source 5সোর্স 5. A component is a JavaScript function, and its name must start with a capital letter Source 5সোর্স 5. Props are the information that you pass to a JSX tag Source 6সোর্স 6.
Next.js uses file-system based routing: folders and files define the routes Source 2সোর্স 2. A page is the UI of one route Source 2সোর্স 2. A layout is UI that several pages share, and it keeps its state on navigation Source 2সোর্স 2.
You start a new app with npx create-next-app@latest [project-name] [options] Source 13সোর্স 13. The --yes flag skips the prompts and uses your saved preferences or the defaults, which include TypeScript and the App Router Source 1সোর্স 1. Next.js needs Node.js 20.9 or later Source 1সোর্স 1.
The language underneath is on JavaScript for Testers and TypeScript for Testers. The test tool is on UI Automation with Playwright.
সহজ English
React builds screens from components: reusable pieces of UI Source 5সোর্স 5. A component is a function whose name starts with a capital letter Source 5সোর্স 5. Props are the information that you pass to a JSX tag Source 6সোর্স 6.
Next.js uses its folders and files to decide the routes of the app Source 2সোর্স 2. A page is the UI of one route Source 2সোর্স 2. A layout is the frame that many pages share, and it keeps its state when you move between them Source 2সোর্স 2.
You start an app with npx create-next-app@latest and a name Source 13সোর্স 13. Add --yes to skip the prompts and use your saved or default choices, such as TypeScript Source 1সোর্স 1. You need Node.js 20.9 or newer Source 1সোর্স 1.
See JavaScript for Testers and TypeScript for Testers for the language, and UI Automation with Playwright for the test tool.
বাংলা ব্যাখ্যা
React markup, CSS আর JavaScript মিলিয়ে component বানাতে দেয়: আবার ব্যবহার করা যায় এমন UI element Source 5সোর্স 5। Component হলো একটা JavaScript function, আর এর নাম বড় হাতের অক্ষর দিয়ে শুরু হতেই হবে Source 5সোর্স 5। Props হলো সেই তথ্য, যা আপনি একটা JSX tag-কে দেন Source 6সোর্স 6।
Next.js file-system based routing ব্যবহার করে: folder আর file দিয়ে route ঠিক হয় Source 2সোর্স 2। Page হলো একটা route-এর UI Source 2সোর্স 2। Layout হলো কয়েকটা page-এর ভাগ করা UI, আর navigation-এর সময় এটা নিজের state ধরে রাখে Source 2সোর্স 2।
নতুন app শুরু হয় npx create-next-app@latest [project-name] [options] দিয়ে Source 13সোর্স 13। --yes flag prompt বাদ দিয়ে আপনার সেভ করা পছন্দ বা ডিফল্ট পছন্দগুলো নেয়, যার মধ্যে আছে TypeScript আর App Router Source 1সোর্স 1। Next.js-এর জন্য Node.js 20.9 বা তার পরের version লাগে Source 1সোর্স 1।
ভেতরের language আছে JavaScript for Testers আর TypeScript for Testers-এ। টেস্ট টুল আছে UI Automation with Playwright-এ।
How it works
- Server Components. By default, layouts and pages are Server Components: they render on the server, and the result streams to the client Source 3সোর্স 3. They can use API keys, tokens, and other secrets without exposing them to the client Source 3সোর্স 3.
- Client Components. The
"use client"directive at the top of a file makes a Client Component Source 3সোর্স 3. You need one for state, event handlers such asonClick, effects, and browser-only APIs Source 3সোর্স 3. Everything that such a file imports goes into the client bundle too Source 3সোর্স 3. - Hydration. The first HTML is static. JavaScript then hydrates the Client Components to make them interactive Source 3সোর্স 3: hydration attaches the event handlers to the HTML Source 3সোর্স 3.
- State.
useStategives a state variable that keeps its value between renders, and a setter that updates it and renders the component again Source 7সোর্স 7. Hooks, the functions whose names start withuse, such asuseState, can only be called at the top level of a component Source 7সোর্স 7. - Events and effects. Event handlers are functions that run in response to clicks, hovers, focus, and other interactions Source 11সোর্স 11. Effects run code after rendering, to sync the component with a system outside React Source 8সোর্স 8.
- Lists. Keys tell React which array item each component belongs to Source 9সোর্স 9.
- Routes. A folder name in square brackets, such as
[id], is a dynamic segment Source 2সোর্স 2. The<Link>component links pages, and Next.js prefetches a linked route when the link enters the viewport Source 4সোর্স 4.
সহজ English
- Server Components. Pages are built on the server by default, and sent to the browser Source 3সোর্স 3. They can use secret keys without exposing them to the browser Source 3সোর্স 3.
- Client Components. Put
"use client"at the top of a file to make a Client Component Source 3সোর্স 3. You need one for state, event handlers such asonClick, effects, and browser-only features Source 3সোর্স 3. - Hydration. The page first arrives as plain HTML. Then JavaScript "hydrates" it to make it interactive: it attaches the event handlers to the HTML Source 3সোর্স 3.
- State.
useStategives the component a memory, and a way to change it that redraws the component Source 7সোর্স 7. Hooks, the functions whose names start withuse, go only at the top level of a component Source 7সোর্স 7. - Events and effects. Event handlers run when the user clicks, hovers, focuses, and so on Source 11সোর্স 11. Effects run after drawing, to keep the component in sync with a system outside React Source 8সোর্স 8.
- Lists. A
keytells React which item of the list each component belongs to Source 9সোর্স 9. - Routes. A folder name in square brackets, like
[id], is a dynamic segment Source 2সোর্স 2.<Link>connects pages, and Next.js loads a linked page early, when the link comes into view Source 4সোর্স 4.
বাংলা ব্যাখ্যা
- Server Component। ডিফল্টভাবে layout আর page হলো Server Component: এগুলো server-এ render হয়, আর ফলাফল stream হয়ে client-এ যায় Source 3সোর্স 3। এগুলো API key, token আর অন্য secret client-এর কাছে প্রকাশ না করেই ব্যবহার করতে পারে Source 3সোর্স 3।
- Client Component। File-এর শুরুতে
"use client"directive দিলে Client Component হয় Source 3সোর্স 3। State,onClick-এর মতো event handler, effect আর শুধু browser-এর API-র জন্য এটা লাগে Source 3সোর্স 3। এমন file যা import করে, তার সবকিছুও client bundle-এ যায় Source 3সোর্স 3। - Hydration। প্রথম HTML স্থির। তারপর JavaScript Client Component-গুলোকে hydrate করে interactive বানায় Source 3সোর্স 3: hydration HTML-এর সাথে event handler জুড়ে দেয় Source 3সোর্স 3।
- State।
useStateএকটা state variable দেয়, যেটা render-এর মাঝে নিজের value ধরে রাখে, আর একটা setter দেয়, যেটা value বদলে component আবার render করায় Source 7সোর্স 7। Hook হলোuseদিয়ে শুরু হওয়া function, যেমনuseState; Hook শুধু component-এর top level-এ call করা যায় Source 7সোর্স 7। - Event আর effect। Event handler হলো এমন function, যেটা click, hover, focus আর অন্য interaction-এর জবাবে চলে Source 11সোর্স 11। Effect render-এর পরে কোড চালায়, component-কে React-এর বাইরের কোনো system-এর সাথে মেলাতে Source 8সোর্স 8।
- List। Key React-কে বলে কোন array item কোন component-এর Source 9সোর্স 9।
- Route।
[id]-এর মতো square bracket-এর ভেতরের folder নাম হলো dynamic segment Source 2সোর্স 2।<Link>component page-গুলো জোড়ে, আর link viewport-এ এলে Next.js linked route আগেভাগে prefetch করে Source 4সোর্স 4।
Try it
Create the app with npx create-next-app@latest my-app --yes --no-cache-components Source 13সোর্স 13. --yes skips the prompts and uses your saved preferences or the defaults Source 1সোর্স 1. --no-* turns a default off, here Cache Components, which is on by default for the App Router Source 13সোর্স 13. With it on, npm run build stops at the product page with Route "/products/[id]": Next.js encountered uncached or runtime data during prerendering. Add the data as app/products.ts:
export const products = [
{ id: 1, name: 'Red pen', price: 20 },
{ id: 2, name: 'Blue mug', price: 350 },
];Add a Client Component as app/counter.tsx. It needs "use client" because it has state and a click handler Source 3সোর্স 3:
'use client';
import { useState } from 'react';
export default function Counter() {
const [count, setCount] = useState(0);
return (
<div>
<p>In cart: {count}</p>
<button onClick={() => setCount(count + 1)}>Add to cart</button>
</div>
);
}Replace app/page.tsx with a Server Component that lists the products, each with a key Source 9সোর্স 9 and a <Link> Source 4সোর্স 4:
import Link from 'next/link';
import Counter from './counter';
import { products } from './products';
export default function Page() {
return (
<main>
<h1>Shop</h1>
<ul>
{products.map((product) => (
<li key={product.id}>
<Link href={`/products/${product.id}`}>{product.name}</Link>
</li>
))}
</ul>
<Counter />
</main>
);
}Add the dynamic route app/products/[id]/page.tsx Source 2সোর্স 2. An unknown id calls notFound():
import { notFound } from 'next/navigation';
import { products } from '../../products';
export default async function ProductPage({
params,
}: {
params: Promise<{ id: string }>;
}) {
const { id } = await params;
const product = products.find((p) => p.id === Number(id));
if (!product) notFound();
return (
<main>
<h1>{product.name}</h1>
<p>Price: {product.price} taka</p>
</main>
);
}Now test it with Playwright. Install Playwright first with npm init playwright (it creates playwright.config.ts), or start from npx create-next-app@latest --example with-playwright with-playwright-app Source 10সোর্স 10. Next.js recommends testing against the production build: run npm run build and npm run start, then npx playwright test Source 10সোর্স 10. Save this as tests/shop.spec.ts:
import { test, expect } from '@playwright/test';
test('the cart counts clicks', async ({ page }) => {
await page.goto('/');
const button = page.getByRole('button', { name: 'Add to cart' });
await button.click();
await button.click();
await expect(page.getByText('In cart: 2')).toBeVisible();
});
test('a product link opens its page', async ({ page }) => {
await page.goto('/');
await page.getByRole('link', { name: 'Blue mug' }).click();
await expect(page).toHaveURL('/products/2');
await expect(page.getByRole('heading', { name: 'Blue mug' })).toBeVisible();
});
test('an unknown product answers 404', async ({ page }) => {
const response = await page.goto('/products/999');
expect(response?.status()).toBe(404);
});With baseURL set to the address of npm run start in playwright.config.ts, all three tests pass.
সহজ English
Make the app with npx create-next-app@latest my-app --yes --no-cache-components Source 13সোর্স 13. --yes skips the prompts and uses your saved or default choices Source 1সোর্স 1, and --no-cache-components turns one default off, Cache Components Source 13সোর্স 13. With it on, npm run build fails on the product page. Add the data as app/products.ts:
export const products = [
{ id: 1, name: 'Red pen', price: 20 },
{ id: 2, name: 'Blue mug', price: 350 },
];Add app/counter.tsx. It needs "use client", because it remembers a number and reacts to clicks Source 3সোর্স 3:
'use client';
import { useState } from 'react';
export default function Counter() {
const [count, setCount] = useState(0);
return (
<div>
<p>In cart: {count}</p>
<button onClick={() => setCount(count + 1)}>Add to cart</button>
</div>
);
}Replace app/page.tsx. Each product gets a key Source 9সোর্স 9 and a <Link> Source 4সোর্স 4:
import Link from 'next/link';
import Counter from './counter';
import { products } from './products';
export default function Page() {
return (
<main>
<h1>Shop</h1>
<ul>
{products.map((product) => (
<li key={product.id}>
<Link href={`/products/${product.id}`}>{product.name}</Link>
</li>
))}
</ul>
<Counter />
</main>
);
}Add app/products/[id]/page.tsx for the product pages Source 2সোর্স 2. An unknown id calls notFound():
import { notFound } from 'next/navigation';
import { products } from '../../products';
export default async function ProductPage({
params,
}: {
params: Promise<{ id: string }>;
}) {
const { id } = await params;
const product = products.find((p) => p.id === Number(id));
if (!product) notFound();
return (
<main>
<h1>{product.name}</h1>
<p>Price: {product.price} taka</p>
</main>
);
}Now test it. Install Playwright first with npm init playwright (it creates playwright.config.ts), or start from npx create-next-app@latest --example with-playwright with-playwright-app Source 10সোর্স 10. Next.js recommends testing against the production build: npm run build, npm run start, then npx playwright test Source 10সোর্স 10. Save this as tests/shop.spec.ts:
import { test, expect } from '@playwright/test';
test('the cart counts clicks', async ({ page }) => {
await page.goto('/');
const button = page.getByRole('button', { name: 'Add to cart' });
await button.click();
await button.click();
await expect(page.getByText('In cart: 2')).toBeVisible();
});
test('a product link opens its page', async ({ page }) => {
await page.goto('/');
await page.getByRole('link', { name: 'Blue mug' }).click();
await expect(page).toHaveURL('/products/2');
await expect(page.getByRole('heading', { name: 'Blue mug' })).toBeVisible();
});
test('an unknown product answers 404', async ({ page }) => {
const response = await page.goto('/products/999');
expect(response?.status()).toBe(404);
});Set baseURL in playwright.config.ts to the address of the app. All three tests pass.
বাংলা ব্যাখ্যা
npx create-next-app@latest my-app --yes --no-cache-components দিয়ে app বানান Source 13সোর্স 13। --yes prompt বাদ দিয়ে সেভ করা বা ডিফল্ট পছন্দগুলো নেয় Source 1সোর্স 1। --no-* একটা ডিফল্ট বন্ধ করে, এখানে Cache Components, যেটা App Router-এ ডিফল্টভাবে চালু থাকে Source 13সোর্স 13। এটা চালু থাকলে npm run build product page-এ থেমে যায়: Route "/products/[id]": Next.js encountered uncached or runtime data during prerendering. ডেটা যোগ করুন app/products.ts হিসেবে:
export const products = [
{ id: 1, name: 'Red pen', price: 20 },
{ id: 2, name: 'Blue mug', price: 350 },
];app/counter.tsx হিসেবে একটা Client Component যোগ করুন। এতে state আর click handler আছে, তাই "use client" লাগে Source 3সোর্স 3:
'use client';
import { useState } from 'react';
export default function Counter() {
const [count, setCount] = useState(0);
return (
<div>
<p>In cart: {count}</p>
<button onClick={() => setCount(count + 1)}>Add to cart</button>
</div>
);
}app/page.tsx বদলে একটা Server Component দিন, যেটা product-গুলো দেখায়, প্রতিটায় একটা key Source 9সোর্স 9 আর একটা <Link> Source 4সোর্স 4:
import Link from 'next/link';
import Counter from './counter';
import { products } from './products';
export default function Page() {
return (
<main>
<h1>Shop</h1>
<ul>
{products.map((product) => (
<li key={product.id}>
<Link href={`/products/${product.id}`}>{product.name}</Link>
</li>
))}
</ul>
<Counter />
</main>
);
}Dynamic route app/products/[id]/page.tsx যোগ করুন Source 2সোর্স 2। অজানা id হলে এটা notFound() call করে:
import { notFound } from 'next/navigation';
import { products } from '../../products';
export default async function ProductPage({
params,
}: {
params: Promise<{ id: string }>;
}) {
const { id } = await params;
const product = products.find((p) => p.id === Number(id));
if (!product) notFound();
return (
<main>
<h1>{product.name}</h1>
<p>Price: {product.price} taka</p>
</main>
);
}এবার Playwright দিয়ে টেস্ট করুন। আগে npm init playwright চালিয়ে Playwright ইনস্টল করুন (এটা playwright.config.ts বানায়), অথবা npx create-next-app@latest --example with-playwright with-playwright-app দিয়ে শুরু করুন Source 10সোর্স 10। Next.js production build-এর ওপর টেস্ট চালানোর পরামর্শ দেয়: npm run build আর npm run start চালিয়ে তারপর npx playwright test Source 10সোর্স 10। এটা tests/shop.spec.ts নামে সেভ করুন:
import { test, expect } from '@playwright/test';
test('the cart counts clicks', async ({ page }) => {
await page.goto('/');
const button = page.getByRole('button', { name: 'Add to cart' });
await button.click();
await button.click();
await expect(page.getByText('In cart: 2')).toBeVisible();
});
test('a product link opens its page', async ({ page }) => {
await page.goto('/');
await page.getByRole('link', { name: 'Blue mug' }).click();
await expect(page).toHaveURL('/products/2');
await expect(page.getByRole('heading', { name: 'Blue mug' })).toBeVisible();
});
test('an unknown product answers 404', async ({ page }) => {
const response = await page.goto('/products/999');
expect(response?.status()).toBe(404);
});playwright.config.ts-এ baseURL হিসেবে npm run start-এর address দিলে তিনটা টেস্টই pass করে।
How a tester uses it
- Test the production build. Next.js recommends running the tests against production code, because it behaves more like the real app Source 10সোর্স 10.
- Know what is interactive. State and event handlers need a Client Component Source 3সোর্স 3. When a button does nothing, look for the component that should own its handler.
- Mind hydration. The first HTML is static until JavaScript hydrates it Source 3সোর্স 3. Until then, the HTML is a fast, non-interactive preview Source 3সোর্স 3. Assert on the result of a click, as the cart test does, not only on the click.
- Read the console. A list item without a key makes React log
Each child in a list should have a unique "key" prop.Source 9সোর্স 9. Collect browser console errors in the tests of the development build. - Check that secrets stay on the server. Server Components can use API keys and tokens without exposing them to the client Source 3সোর্স 3. Search the page source and the JavaScript that the browser loads for keys and tokens.
- Test unknown routes. A dynamic segment generates many pages from data Source 2সোর্স 2, so also test an id that does not exist. The third test expects
404.
সহজ English
- Test the real build. Next.js recommends testing the production build, because it more closely resembles how the app will behave Source 10সোর্স 10.
- Know what can be clicked. State and event handlers, such as a click handler, need a Client Component Source 3সোর্স 3. If a button does nothing, find the component that should handle it.
- Mind hydration. The page is plain HTML until JavaScript wakes it up Source 3সোর্স 3. Check the result of a click, not just the click itself.
- Read the console. A list item without a
keymakes React log a message Source 9সোর্স 9. Let the tests of the development build collect console errors. - Check that secrets stay hidden. Server Components can use keys without sending them to the browser Source 3সোর্স 3. Search what the browser gets for keys and tokens.
- Test unknown routes. One
[id]folder makes many pages from data Source 2সোর্স 2, so also try an id that does not exist.
বাংলা ব্যাখ্যা
- Production build টেস্ট করুন। Next.js production কোডের ওপর টেস্ট চালানোর পরামর্শ দেয়, কারণ app আসলে কেমন আচরণ করবে, তার সাথে এটা বেশি মেলে Source 10সোর্স 10।
- কী interactive, তা জানুন। State আর event handler-এর জন্য Client Component লাগে Source 3সোর্স 3। কোনো button কিছু না করলে সেই component খুঁজুন, যার কাছে এর handler থাকার কথা।
- Hydration মাথায় রাখুন। JavaScript hydrate না করা পর্যন্ত প্রথম HTML স্থির থাকে Source 3সোর্স 3। তার আগে HTML একটা দ্রুত, non-interactive preview Source 3সোর্স 3। শুধু click নয়, cart-এর টেস্টের মতো click-এর ফলাফলের ওপর assert করুন।
- Console পড়ুন। Key ছাড়া list item থাকলে React লগ করে
Each child in a list should have a unique "key" prop.Source 9সোর্স 9। Development build-এর টেস্টে browser console-এর error সংগ্রহ করুন। - Secret server-এই থাকে কি না চেক করুন। Server Component API key আর token client-এর কাছে প্রকাশ না করেই ব্যবহার করতে পারে Source 3সোর্স 3। Page source আর browser যে JavaScript নামায়, তাতে key আর token খুঁজুন।
- অজানা route টেস্ট করুন। Dynamic segment দিয়ে ডেটা থেকে অনেক page তৈরি হয় Source 2সোর্স 2, তাই এমন একটা id-ও টেস্ট করুন, যেটা নেই। তৃতীয় টেস্ট
404আশা করে।
Common mistakes
- State in a Server Component. State and event handlers need a Client Component, marked with
"use client"Source 3সোর্স 3. "use client"on a large file. Everything that the file imports goes into the client bundle Source 3সোর্স 3, so the browser downloads more JavaScript than it needs.- A Hook inside a condition. Hooks can only be called at the top level of a component or of another Hook Source 7সোর্স 7.
- The index as a key. Using the index as a key often leads to subtle and confusing bugs, when items move, are inserted, or are deleted Source 9সোর্স 9.
- An Effect for a value you can calculate. If you can calculate something during render, you do not need an Effect Source 12সোর্স 12.
- Testing only the development server. The tests should run against the production build Source 10সোর্স 10.
সহজ English
- State in a Server Component. State and event handlers need
"use client"Source 3সোর্স 3. "use client"on a big file. Everything it imports goes to the browser too Source 3সোর্স 3.- A Hook inside an
if. Call Hooks only at the top level of a component or of another Hook Source 7সোর্স 7. - The index as a key. It often causes strange bugs when items move Source 9সোর্স 9.
- An Effect for a value you can work out. If you can calculate it while drawing, skip the Effect Source 12সোর্স 12.
- Testing only the dev server. Run the tests against the production build Source 10সোর্স 10.
বাংলা ব্যাখ্যা
- Server Component-এ state। State আর event handler-এর জন্য
"use client"চিহ্নিত Client Component লাগে Source 3সোর্স 3। - বড় file-এ
"use client"। File যা import করে, তার সবকিছু client bundle-এ যায় Source 3সোর্স 3, ফলে browser দরকারের চেয়ে বেশি JavaScript নামায়। - শর্তের ভেতরে Hook। Hook শুধু component বা অন্য Hook-এর top level-এ call করা যায় Source 7সোর্স 7।
- Index-কে key বানানো। Item সরলে, ঢুকলে বা মুছলে index-কে key হিসেবে ব্যবহার করা প্রায়ই সূক্ষ্ম আর বিভ্রান্তিকর bug আনে Source 9সোর্স 9।
- হিসাব করা যায় এমন value-র জন্য Effect। Render-এর সময় কিছু হিসাব করা গেলে Effect লাগে না Source 12সোর্স 12।
- শুধু development server টেস্ট করা। টেস্ট চালানো উচিত production build-এর ওপর Source 10সোর্স 10।
What a tester can check
Tutorial advice
This list is the tutorial's own advice, not a fact from a source.
- Roles and names. Can every button, link, and field be found by its role and its visible name?
- First click. Does the first click work on a slow network, right after the page appears?
- Console. Is the browser console free of errors and warnings on each page?
- Unknown URLs. Do unknown ids and unknown paths answer
404with a helpful page? - Secrets. Is the JavaScript that the browser loads free of API keys and tokens?
- Lists. Do lists keep the right item in the right place after sorting, adding, and deleting?
সহজ English
Tutorial advice
This list is the tutorial's own advice, not a fact from a source.
- Roles and names. Can every button and link be found by its role and its text?
- First click. Does the first click work on a slow network?
- Console. Is the console free of errors?
- Unknown URLs. Do wrong ids get a helpful
404page? - Secrets. Is the browser's JavaScript free of keys and tokens?
- Lists. Do items stay right after sorting, adding, and deleting?
বাংলা ব্যাখ্যা
Tutorial advice
এই তালিকা টিউটোরিয়ালের নিজের পরামর্শ, কোনো source থেকে নেওয়া তথ্য নয়।
- Role আর নাম। প্রতিটা button, link আর field কি তার role আর দৃশ্যমান নাম দিয়ে খুঁজে পাওয়া যায়?
- প্রথম click। Page দেখা দেওয়ার ঠিক পরে, ধীর network-এও কি প্রথম click কাজ করে?
- Console। প্রতিটা page-এ browser console কি error আর warning-মুক্ত?
- অজানা URL। অজানা id আর অজানা path কি কাজের একটা page-সহ
404দেয়? - Secret। Browser যে JavaScript নামায়, তাতে কি কোনো API key বা token নেই?
- List। Sort, যোগ আর মোছার পরে list কি ঠিক item ঠিক জায়গায় রাখে?
Key words
| Term | Meaning |
|---|---|
| Component | A JavaScript function whose name must start with a capital letter. |
| Props | The information that you pass to a JSX tag. |
| State | A component's memory; useState keeps it and re-renders on change. |
| Hook | A function whose name starts with use, called at the top level of a component. |
| Effect | Code that runs after rendering, to sync with something outside React. |
| Key | A value that tells React which list item is which. |
| Server Component | The default in Next.js; renders on the server and can use secrets safely. |
| Client Component | A component in a "use client" file; it can have state and event handlers. |
| Hydration | Attaching event handlers to the server HTML, to make it interactive. |
| Dynamic segment | A route folder in square brackets, such as [id]. |
| Prefetching | Next.js loads a linked route early, when the link enters the viewport. |