iwantcoding.com
🔥 Daily 👥 Rooms 🏆 Top Log in Sign up
Next »

React Summary

Wrapping up the React track with what you can ship and where to go next.

What you learned + first Next.js page

EXAMPLE
# React summary

You can now:

- Compose components with JSX, props, and children
- Manage state with useState, useReducer, derived state, and context
- Fetch data with TanStack Query / SWR; suspend on it where it fits
- Handle forms with Zod + react-hook-form
- Build accessible UIs with semantic HTML + focus management
- Test with Vitest + RTL + MSW + Playwright
- Optimise with the Profiler, virtualisation, code splitting
- Ship with Vite, Next, or Remix on your favourite host

# Your next step - a Next.js server component

// app/page.tsx
import { db } from '@/lib/db';

export default async function Home() {
  const stats = await db.stats.findFirst();   // runs on the server
  return (
    <main className='p-6'>
      <h1 className='text-2xl font-semibold'>Active users</h1>
      <p className='mt-2 text-4xl font-bold'>{stats.activeUsers}</p>
    </main>
  );
}

// app/dashboard/page.tsx - lazy-load a heavy chart
import dynamic from 'next/dynamic';

const Chart = dynamic(() => import('./Chart'), {
  loading: () => <p>loading chart...</p>,
  ssr: false
});

export default function Dashboard() {
  return <Chart />;
}

Why it matters

React is now the foundation, not the destination. Pair it with TanStack Query, a router, a forms lib, and a deployment target and the daily work is mostly product, not framework. Keep an eye on the React Compiler - it removes most of the manual memoisation work in the next year.

Tip: Tweak the snippet with Try it Yourself », then sit the quiz at the bottom of the page.

Example

Example
// You can: build components, manage state, fetch, test, deploy.
console.log('Next: a real framework like Next.js or Remix.');
Try it Yourself »

Discussion

Loading…

Next »