JavaScript and React course ยท Module 10: React Ecosystem and Future

React Server Components (RSC) - The Future of React

13 min read ยท
In this lesson6

The mission panel shows posts from the database and a like button. In a classic application, all of the component code, together with the libraries and query logic, ends up in the browser, and you fetch the data only after the page has loaded. React Server Components flip this split: some components run only on the server, have direct access to data and do not add a single byte to the JavaScript bundle. It is a fundamental change in how we think about React applications.

What Are React Server Components?

A Server Component renders on the server, at build time or on every request. Its output is not ready-made HTML, but the RSC Payload, a serialized description of the UI tree with slots for client components. The request cycle looks like this: the client asks for a page, the server components fetch data and create the payload, the client builds the tree from it, and finally the client components are hydrated, meaning they get their events and state. HTML can additionally be produced through SSR.

Differences Between RSC and SSR

Classic SSR renders the whole application to HTML, and then sends all of its code to the browser for hydration anyway. RSC lets you mix server and client components in one tree:

// Classic SSR (Pages Router) - the data comes from getServerSideProps
export async function getServerSideProps() {
  const posts = await fetchPosts(); // Runs on the server on every request
  return { props: { posts } };
}

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

  // This component and all its imports also end up in the browser
  return (
    <div>
      <PostsList posts={posts} />
      <Counter count={count} setCount={setCount} />
    </div>
  );
}

// React Server Components - server and client mix
async function ServerComponentPage() {
  // This code runs ONLY on the server
  const posts = await fetchPosts(); // Direct database call
  const user = await getUser();

  return (
    <div>
      {/* Server Component - rendered on server */}
      <PostsList posts={posts} />

      {/* Client Component - interactive on client */}
      <Counter />

      {/* Server Component with server data */}
      <UserProfile user={user} />
    </div>
  );
}

In classic SSR the data is fetched by a separate getServerSideProps function, and the page component receives it in its props. The server renders HTML from it, but the code of TraditionalSSRPage, PostsList and all their libraries still goes to the browser for hydration. ServerComponentPage is asynchronous and waits for the data itself: its code stays on the server, and only the interactive Counter reaches the browser.

Server Components Basics

In the Next.js App Router every component is a server component by default. The 'use client' directive at the very top of a file marks the boundary: this module and its imports go to the browser and can use hooks, events and state:

// ServerComponent.jsx (server component by default)
import { db } from './database';

export default async function PostsList() {
  // Direct database access
  const posts = await db.posts.findMany({
    include: { author: true },
    orderBy: { createdAt: 'desc' }
  });

  return (
    <div className="posts-list">
      {posts.map(post => (
        <article key={post.id}>
          <h2>{post.title}</h2>
          <p>By {post.author.name}</p>
          <p>{post.excerpt}</p>

          {/* Client Component for interaction */}
          <LikeButton postId={post.id} initialLikes={post.likes} />
        </article>
      ))}
    </div>
  );
}

// LikeButton.jsx (client component)
'use client'; // Directive marking a client component

import { useState } from 'react';

export default function LikeButton({ postId, initialLikes }) {
  const [likes, setLikes] = useState(initialLikes);
  const [isLiking, setIsLiking] = useState(false);

  const handleLike = async () => {
    setIsLiking(true);
    try {
      const response = await fetch(`/api/posts/${postId}/like`, {
        method: 'POST'
      });
      const data = await response.json();
      setLikes(data.likes);
    } catch (error) {
      console.error('Failed to like post:', error);
    } finally {
      setIsLiking(false);
    }
  };

  return (
    <button
      onClick={handleLike}
      disabled={isLiking}
      className="like-button"
    >
      {likes} {isLiking && '...'}
    </button>
  );
}

PostsList queries the database directly, and LikeButton handles clicks through useState. The server component renders the client one as a child and passes it serializable props, such as postId. In a project these are two separate files, because the directive only works at the beginning of a file.

Fetching Data in Server Components

A Server Component can safely use secrets and database queries, because its code never reaches the browser. React's cache function remembers the result within a single request:

// utils/api.js (server-side only)
import { cache } from 'react';

// Automatic caching for the same request
export const getPosts = cache(async () => {
  const response = await fetch('https://api.example.com/posts', {
    // Server Components can safely use secrets
    headers: {
      'Authorization': `Bearer ${process.env.API_SECRET}`
    }
  });
  return response.json();
});

export const getUser = cache(async (id) => {
  // Direct database query
  return await db.user.findUnique({
    where: { id },
    include: { profile: true }
  });
});

// components/PostsPage.jsx
import { getPosts, getUser } from '../utils/api';
import { Suspense } from 'react';

export default async function PostsPage({ userId }) {
  // Parallel data fetching
  const [posts, user] = await Promise.all([
    getPosts(),
    getUser(userId)
  ]);

  return (
    <main>
      <h1>Welcome, {user.name}!</h1>

      {/* Nested Server Component with its own data fetching */}
      <Suspense fallback={<div>Loading posts...</div>}>
        <PostsList posts={posts} />
      </Suspense>

      {/* Client Component for interaction */}
      <CreatePostForm userId={userId} />
    </main>
  );
}

Promise.all fetches the posts and the user in parallel. cache works only in Server Components and deduplicates calls with the same arguments, so several components can call getUser(userId) without extra queries.

Streaming and Suspense

Not every part of the page loads equally fast. Suspense with the fallback property marks a boundary: the server first sends a placeholder skeleton, and streams the finished sections afterwards:

// components/DashboardPage.jsx
import { Suspense } from 'react';

export default function DashboardPage() {
  return (
    <div className="dashboard">
      <h1>Dashboard</h1>

      {/* Fast loading content */}
      <Suspense fallback={<SkeletonCard />}>
        <UserStats />
      </Suspense>

      {/* Slower loading content */}
      <Suspense fallback={<SkeletonChart />}>
        <AnalyticsChart />
      </Suspense>

      {/* Very slow loading content */}
      <Suspense fallback={<SkeletonTable />}>
        <ReportsTable />
      </Suspense>
    </div>
  );
}

// components/UserStats.jsx (Server Component)
async function UserStats() {
  // Fast query - cache hit
  const stats = await getUserStats();

  return (
    <div className="stats-grid">
      <StatCard title="Total Users" value={stats.totalUsers} />
      <StatCard title="Active Today" value={stats.activeToday} />
      <StatCard title="Revenue" value={`$${stats.revenue}`} />
    </div>
  );
}

// components/AnalyticsChart.jsx (Server Component)
async function AnalyticsChart() {
  // Medium-length query
  const chartData = await getAnalyticsData();

  return (
    <div className="chart-container">
      {/* Client Component for interactive chart */}
      <InteractiveChart data={chartData} />
    </div>
  );
}

// components/ReportsTable.jsx (Server Component)
async function ReportsTable() {
  // Long query - complex aggregations
  const reports = await getComplexReports();

  return (
    <div className="reports-table">
      <table>
        <thead>
          <tr>
            <th>Report</th>
            <th>Status</th>
            <th>Date</th>
          </tr>
        </thead>
        <tbody>
          {reports.map(report => (
            <tr key={report.id}>
              <td>{report.name}</td>
              <td>{report.status}</td>
              <td>{report.date}</td>
            </tr>
          ))}
        </tbody>
      </table>
    </div>
  );
}

Each section has its own boundary, so the slow reports table does not block the statistics. Suspense handles the loading state, and errors are caught by an Error Boundary, so together they cover the whole cycle of an asynchronous operation. It is the same streaming you learned about in the Streaming SSR lesson.

Composing Server and Client Components

Here are the composition patterns that work, and one that fails:

// patterns/CompositionPatterns.jsx

// GOOD - Server Component can render Client Component
async function ServerParent() {
  const data = await fetchData();

  return (
    <div>
      <h1>Server Rendered Title</h1>
      <ClientChild data={data} />
    </div>
  );
}

// GOOD - Client Component can render Server Component via children
'use client';
function ClientWrapper({ children }) {
  const [isOpen, setIsOpen] = useState(false);

  return (
    <div>
      <button onClick={() => setIsOpen(!isOpen)}>
        Toggle Content
      </button>
      {isOpen && children}
    </div>
  );
}

// Usage:
function ParentPage() {
  return (
    <ClientWrapper>
      <ServerContent /> {/* Server Component as children */}
    </ClientWrapper>
  );
}

// BAD - Client Component cannot directly import Server Component
'use client';
function BadClientComponent() {
  const [show, setShow] = useState(false);

  return (
    <div>
      {show && <ServerContent />} {/* This won't work! */}
    </div>
  );
}

// GOOD - Server Component passed as a prop from JSX (slot)
'use client';
function GoodClientComponent({ content }) {
  const [show, setShow] = useState(false);

  return (
    <div>
      <button onClick={() => setShow(!show)}>Toggle</button>
      {show && content}
    </div>
  );
}

// Usage:
function ParentComponent() {
  return (
    <GoodClientComponent
      content={<ServerContent />}
    />
  );
}

The recommended pattern is a Server Component rendering a Client Component as a child. When a client component needs to contain a server one, pass it as children or as a prop from JSX. You cannot send a function, such as a render prop, from the server to the client, because it cannot be serialized, and importing a server component in a file with 'use client' turns it into a client component.

Advanced Patterns

Mutations with Server Functions

For changing data there are Server Functions with the 'use server' directive, called Server Actions in forms. The form calls them without you writing your own endpoint:

// actions/postActions.js
'use server'; // Server Actions

import { revalidatePath } from 'next/cache';

export async function createPost(prevState, formData) {
  const title = formData.get('title');
  const content = formData.get('content');

  // Server-side validation
  if (!title || !content) {
    return { error: 'Title and content are required' };
  }

  try {
    const post = await db.post.create({
      data: { title, content, userId: getCurrentUserId() }
    });

    // Revalidate cache for the posts page
    revalidatePath('/posts');

    return { success: true, post };
  } catch (error) {
    return { error: 'Failed to create post' };
  }
}

export async function deletePost(postId) {
  try {
    await db.post.delete({
      where: { id: postId }
    });

    revalidatePath('/posts');
    return { success: true };
  } catch (error) {
    return { error: 'Failed to delete post' };
  }
}

// components/CreatePostForm.jsx
'use client';

import { createPost } from '../actions/postActions';
import { useActionState } from 'react';
import { useFormStatus } from 'react-dom';

function SubmitButton() {
  const { pending } = useFormStatus();

  return (
    <button type="submit" disabled={pending}>
      {pending ? 'Creating...' : 'Create Post'}
    </button>
  );
}

export default function CreatePostForm() {
  const [state, formAction] = useActionState(createPost, null);

  return (
    <form action={formAction}>
      <div>
        <label htmlFor="title">Title:</label>
        <input
          type="text"
          id="title"
          name="title"
          required
        />
      </div>

      <div>
        <label htmlFor="content">Content:</label>
        <textarea
          id="content"
          name="content"
          required
        />
      </div>

      {state?.error && (
        <div className="error">{state.error}</div>
      )}

      {state?.success && (
        <div className="success">Post created successfully!</div>
      )}

      <SubmitButton />
    </form>
  );
}

useActionState passes the previous state to the action as the first argument and the form data as the second, which is why createPost takes prevState, formData. useFormStatus disables the button while submitting, and revalidatePath('/posts') refreshes the list. Validation in the action is mandatory, because an action is a public endpoint.

Caching Strategies

React's cache only works within a single request. To remember the result of an expensive query between requests, Next.js 16 has the 'use cache' directive, which you enable with the cacheComponents: true option in next.config.js. cacheLife sets how long an entry lives, and cacheTag gives it a label for invalidation:

// lib/posts.js
import { cacheLife, cacheTag } from 'next/cache';

export async function getCachedPosts() {
  'use cache';
  cacheLife('minutes'); // Background refresh roughly every minute
  cacheTag('posts');

  return db.post.findMany({
    include: { author: true },
    orderBy: { createdAt: 'desc' },
  });
}

export async function getCachedUser(userId) {
  'use cache';
  cacheLife('hours');
  cacheTag('users');

  // userId becomes part of the cache key
  return db.user.findUnique({
    where: { id: userId },
    include: { profile: true },
  });
}

// components/PostsWithCache.jsx
import { getCachedPosts } from '../lib/posts';

export default async function PostsWithCache() {
  const posts = await getCachedPosts();

  return (
    <div>
      <h1>Cached Posts</h1>
      {posts.map(post => (
        <article key={post.id}>
          <h2>{post.title}</h2>
          <p>By {post.author.name}</p>
        </article>
      ))}
    </div>
  );
}

// actions/cacheActions.js
'use server';

import { revalidateTag, updateTag } from 'next/cache';

export async function refreshPosts() {
  revalidateTag('posts', 'max'); // Old data stays, fresh data loads in the background
}

export async function publishPost(formData) {
  await db.post.create({ data: { title: formData.get('title') } });
  updateTag('posts'); // The author sees their post right away
}

Function arguments, such as userId, automatically become part of the cache key, so every user gets a separate entry. revalidateTag('posts', 'max') marks the data as stale and refreshes it in the background on the next request, while updateTag, available only in Server Actions, expires it immediately so the author sees their change. The older unstable_cache was replaced by 'use cache' in Next.js 16, and the single-argument revalidateTag is deprecated.

Performance and Optimizations

The biggest gain from RSC is not visible in the code: server components and their imports do not end up in the client bundle:

// Server Components don't end up in the client bundle!

// ServerHeavyComponent.jsx (Server Component)
import { someHeavyLibrary } from 'heavy-library'; // Won't be in client bundle!
import { complexCalculation } from './utils/complex';

export default async function ServerHeavyComponent() {
  const data = await fetchData();
  const processed = complexCalculation(data); // Happens on server
  const result = someHeavyLibrary.process(processed);

  return (
    <div>
      <h2>Processed Data</h2>
      <pre>{JSON.stringify(result, null, 2)}</pre>
    </div>
  );
}

// ClientLightComponent.jsx (Client Component)
'use client';

import { useState } from 'react';

export default function ClientLightComponent({ serverData }) {
  const [selected, setSelected] = useState(null);

  return (
    <div>
      {serverData.map(item => (
        <button
          key={item.id}
          onClick={() => setSelected(item)}
          className={selected?.id === item.id ? 'selected' : ''}
        >
          {item.name}
        </button>
      ))}
      {selected && <ItemDetails item={selected} />}
    </div>
  );
}

heavy-library runs only on the server, so the user does not download it. Only the lightweight ClientLightComponent reaches the browser.

Error Boundaries for Server Components

An error in a server component goes to the nearest error boundary on the client side. An Error Boundary has to be a class, so the file starts with 'use client':

// components/ServerErrorBoundary.jsx
'use client';

import { Component } from 'react';

export class ServerErrorBoundary extends Component {
  constructor(props) {
    super(props);
    this.state = { hasError: false, error: null };
  }

  static getDerivedStateFromError(error) {
    return { hasError: true, error };
  }

  componentDidCatch(error, errorInfo) {
    console.error('Server component error:', error, errorInfo);
    // Send to monitoring service
  }

  render() {
    if (this.state.hasError) {
      return (
        <div className="error-boundary">
          <h2>Something went wrong on the server</h2>
          <details>
            <summary>Error details</summary>
            <pre>{this.state.error?.message}</pre>
          </details>
          <button
            onClick={() => this.setState({ hasError: false })}
          >
            Try again
          </button>
        </div>
      );
    }

    return this.props.children;
  }
}

// Usage in layout
export default function Layout({ children }) {
  return (
    <html>
      <body>
        <ServerErrorBoundary>
          {children}
        </ServerErrorBoundary>
      </body>
    </html>
  );
}

getDerivedStateFromError switches the view to a fallback screen, and componentDidCatch reports the error. In production Next.js hides the content of server errors, so you will see a generic message, and you will find the details in the logs. In Next.js you do not have to write this class yourself: an error.js file creates an error boundary for a whole route segment, and since version 16.3 the catchError function from next/error builds one from a function component and passes it retry(), which also re-renders Server Components.

The first framework to fully integrate RSC was Next.js with the App Router. I recommend starting every component as a server component and adding 'use client' only where you need state or events. RSC give you better performance, automatic code splitting and safer server-side operations, and in the Partial Pre-rendering lesson you will combine them with a static page shell.

Remember: Server Components are the ground station crew - they prepare the data and send up a ready plan, and only the modules someone actually steers make it on board. In the example below the "Show what reaches the browser" button marks which code stays on the server and which runs in the browser.

Code for this lesson: App.jsx
import { Suspense, use, useState } from 'react';

// === React Server Components - a simulation in the browser ===
// A real Server Component is an asynchronous function that runs on the server:
//   async function PostsList() { const posts = await db.post.findMany(); ... }
// The browser cannot run such code, so we fake the "server" with a promise read
// by use(), and Suspense handles the waiting, just like when the RSC Payload is
// streamed.

const database = {
  stats: { posts: 156, crew: 89, online: 23 },
  posts: [
    { id: 1, title: 'Discovery of a new galaxy', author: 'Commander Nova', likes: 42 },
    { id: 2, title: 'Space propulsion technologies', author: 'Astro', likes: 28 },
    { id: 3, title: 'Life on Mars - a report', author: 'Ra', likes: 56 },
  ],
};

const serverCache = new Map();

// "Database query" - the same promise for the same table
function queryServer(table, delay) {
  if (!serverCache.has(table)) {
    serverCache.set(table, new Promise(resolve => setTimeout(() => resolve(database[table]), delay)));
  }
  return serverCache.get(table);
}

function Tag({ type, show }) {
  if (!show) return null;
  const server = type === 'server';
  return (
    <span style={{ ...styles.tag, ...(server ? styles.serverTag : styles.clientTag) }}>
      {server ? 'Server Component: 0 KB of code in the JS bundle' : "Client Component ('use client'): code in the JS bundle"}
    </span>
  );
}

// SERVER COMPONENT (simulation): no state or events, just data and JSX
function ServerStats({ showBundle }) {
  const stats = use(queryServer('stats', 600));

  return (
    <section style={{ ...styles.box, ...(showBundle ? styles.serverBox : null) }}>
      <Tag type="server" show={showBundle} />
      <div style={styles.statsGrid}>
        <div style={styles.stat}><strong style={styles.statValue}>{stats.posts}</strong>Posts</div>
        <div style={styles.stat}><strong style={styles.statValue}>{stats.crew}</strong>Crew members</div>
        <div style={styles.stat}><strong style={styles.statValue}>{stats.online}</strong>Online</div>
      </div>
    </section>
  );
}

// SERVER COMPONENT (simulation): renders a client component as a child
// and passes it only serializable props (the number of likes)
function ServerPostsList({ showBundle }) {
  const posts = use(queryServer('posts', 1200));

  return (
    <section style={{ ...styles.box, ...(showBundle ? styles.serverBox : null) }}>
      <Tag type="server" show={showBundle} />
      {posts.map(post => (
        <article key={post.id} style={styles.post}>
          <h3 style={styles.postTitle}>{post.title}</h3>
          <div style={styles.postMeta}>
            <span>Author: {post.author}</span>
            <LikeButton initialLikes={post.likes} showBundle={showBundle} />
          </div>
        </article>
      ))}
    </section>
  );
}

// CLIENT COMPONENT: in a project, a separate file starting with 'use client'.
// Only this code reaches the browser and can use state and events.
function LikeButton({ initialLikes, showBundle }) {
  const [liked, setLiked] = useState(false);
  const likes = initialLikes + (liked ? 1 : 0);

  return (
    <span style={showBundle ? styles.clientBox : null}>
      <Tag type="client" show={showBundle} />
      <button onClick={() => setLiked(l => !l)} style={{ ...styles.like, color: liked ? '#ff6b6b' : '#8892b0' }}>
        {liked ? 'Liked' : 'Like'} ({likes})
      </button>
    </span>
  );
}

export default function App() {
  const [showBundle, setShowBundle] = useState(false);

  return (
    <div style={styles.page}>
      <div style={{ maxWidth: '700px', margin: '0 auto' }}>
        <h1 style={styles.title}>React Server Components - simulation</h1>
        <p style={styles.subtitle}>
          Server components fetch the data, and only the interactive like button runs in the browser
        </p>
        <button onClick={() => setShowBundle(s => !s)} style={styles.toggle}>
          {showBundle ? 'Hide the server and client split' : 'Show what reaches the browser'}
        </button>

        <Suspense fallback={<p style={styles.fallback}>The server is counting statistics...</p>}>
          <ServerStats showBundle={showBundle} />
        </Suspense>

        <h2 style={styles.h2}>Posts from the database (Server Component + client LikeButton)</h2>
        <Suspense fallback={<p style={styles.fallback}>The server is fetching posts from the database...</p>}>
          <ServerPostsList showBundle={showBundle} />
        </Suspense>
      </div>
    </div>
  );
}

const styles = {
  page: { minHeight: '100vh', background: 'linear-gradient(135deg, #0a0e27 0%, #1a1a3e 100%)', padding: '24px', color: '#e0e1dd', fontFamily: 'system-ui, sans-serif' },
  title: { textAlign: 'center', color: '#00d4ff', margin: '0 0 6px', fontSize: '22px' },
  subtitle: { textAlign: 'center', color: '#8892b0', margin: '0 0 14px', fontSize: '13px' },
  toggle: { display: 'block', margin: '0 auto 16px', padding: '6px 14px', background: 'rgba(0,212,255,0.15)', color: '#00d4ff', border: '1px solid rgba(0,212,255,0.4)', borderRadius: '6px', cursor: 'pointer' },
  fallback: { color: '#8892b0', padding: '16px', border: '1px dashed rgba(0,212,255,0.25)', borderRadius: '8px' },
  box: { borderRadius: '10px', padding: '10px', marginBottom: '16px', border: '1px solid transparent' },
  serverBox: { border: '1px dashed #ffa500', background: 'rgba(255,165,0,0.05)' },
  clientBox: { display: 'inline-flex', flexDirection: 'column', alignItems: 'flex-end', gap: '2px', padding: '4px', border: '1px solid #00ff88', borderRadius: '6px' },
  tag: { display: 'inline-block', fontSize: '10px', padding: '2px 6px', borderRadius: '4px', marginBottom: '6px' },
  serverTag: { background: 'rgba(255,165,0,0.15)', color: '#ffa500' },
  clientTag: { background: 'rgba(0,255,136,0.15)', color: '#00ff88', marginBottom: 0 },
  statsGrid: { display: 'grid', gridTemplateColumns: 'repeat(3, 1fr)', gap: '10px' },
  stat: { padding: '12px', background: 'rgba(0,212,255,0.08)', borderRadius: '8px', textAlign: 'center', fontSize: '12px', color: '#8892b0' },
  statValue: { display: 'block', fontSize: '24px', color: '#00d4ff' },
  h2: { color: '#64ffda', fontSize: '16px', margin: '0 0 8px' },
  post: { padding: '10px 12px', margin: '6px 0', background: 'rgba(0,0,0,0.3)', borderRadius: '8px', border: '1px solid rgba(0,212,255,0.15)' },
  postTitle: { color: '#00d4ff', margin: '0 0 6px', fontSize: '15px' },
  postMeta: { display: 'flex', justifyContent: 'space-between', alignItems: 'center', fontSize: '12px', color: '#8892b0', gap: '8px' },
  like: { background: 'none', border: 'none', cursor: 'pointer', fontSize: '12px' },
};

Docs entries used in this lesson

Spotted a mistake in this lesson?

Check yourself

Answer the questions from this lesson. Pick an answer to see right away whether it is correct.

  1. 1. What does the 'use client' directive at the beginning of a component file mean?

  2. 2. What is the key difference between React Server Components and traditional SSR?

These are 2 of 5 questions for this lesson. Solve the rest in the game.

Hands-on tasks in the game

  • Click in order

    Arrange the Suspense boundary syntax with a fallback component:

  • Code editor

    Show constellation data from the observatory with Suspense and use() from React 19. ___BLANK1___: getConstellation stores in the cache the promise from fetchConstellation(name), so that every name is fetched only once. ___BLANK2___: ConstellationCard reads the data with use() from the promise returned by getConstellation(name) (do not create a new promise during render). ___BLANK3___: the fallback of the Suspense boundary is an element with a loading text, e.g. <p>Loading telescope data...</p>. After clicking another constellation you will see the fallback for a moment, and when you go back to one that was already fetched, the data appears at once.

  • Vertical ordering

    Order the stages of the Streaming SSR pipeline in React (since version 18):

  • Code editor

    Finish the MissionBoundary class, the error boundary for the bridge panels. The fuel sensor is broken and its panel throws an error, while the other panels must keep working. ___BLANK1___: getDerivedStateFromError returns the new state with an error field that holds the caught error ({ error }). ___BLANK2___: componentDidCatch reports the crash with reportCrash(error, info.componentStack). ___BLANK3___: when the state holds an error, render returns the view from this.props.renderFallback, passing it the error from state and the this.reset function (the class stays free of JSX). Clicking Restart sensor repairs the sensor and resets the boundary, so the fuel panel comes back showing 50%.

  • Horizontal ordering

    Arrange the syntax for wrapping a component in Error Boundary with fallback:

  • Vertical ordering

    Order the request lifecycle in the React Server Components architecture:

  • Click in order

    Order the Server Component implementation:

  • Code editor

    Complete the buttons of the Fleet component library. ___BLANK1___: the button is disabled when it has the disabled prop or while it is loading (loading). ___BLANK2___: the padding comes from the tokens: tokens.spacing for the chosen size (sm, md or lg). ___BLANK3___: IconButton shows only an icon, so pass Button an aria-label attribute with the value of label, so that a screen reader announces the button name. The components have no state and no effects, so they also work in Server Components.

  1. QuestionThe 'use client' Directive
  2. Click in orderSuspense Syntax with Fallback
  3. QuestionServer Components vs SSR
  4. QuestionServer and Client Component Composition
  5. Coding taskPractice: Suspense for Data Fetching
  6. QuestionError Boundary and Suspense
  7. Put in orderStreaming SSR Pipeline
  8. Coding taskPractice: Error Boundaries
  9. Put in orderError Boundary Syntax with Fallback
  10. Put in orderRequest Lifecycle with React Server Components
  11. Click in orderServer Components Implementation
  12. QuestionReact Server Components Adoption
  13. Coding taskPractice: Component Library

Useful articles