Server Components (Default)

export default async function ProductList() {
  const res = await fetch("<https://fakestoreapi.com/products>", { cache: "no-store" });
  const products = await res.json();

  return (
    <ul>
      {products.map((product) => (
        <li key={product.id}>{product.title}</li>
      ))}
    </ul>
  );
}

Client Components (use client required)

Required When:

"use client";
import { useState } from "react";

export default function Counter() {
  const [count, setCount] = useState(0);

  return <button onClick={() => setCount((prev) => prev + 1)}>Count: {count}</button>;
}