Intermedio
4 ottobre 2026

Trova il bug: React / Next.js

Uno snippet di codice. Trova il bug, o dimostra che non ce n'è.

tsx
1interface Order {
2  id: string
3  status: 'pending' | 'shipped' | 'delivered' | 'cancelled'
4  trackingNumber?: string
5}
6
7export function OrderStatus({ order }: { order: Order }) {
8  return (
9    <div className="status">
10      {order.status === 'pending' ? (
11        <span>Pending</span>
12      ) : order.status === 'shipped' ? (
13        <span>Shipped: {order.trackingNumber}</span>
14      ) : order.status === 'delivered' ? (
15        <span>Delivered</span>
16      ) : (
17        <span>Cancelled</span>
18      )}
19    </div>
20  )
21}

Clicca sulle righe che causano il problema.

Il tuo verdetto

Un tentativo al giorno. La risposta appare subito dopo.

Mantieni la tua serie

Crea un account per conservare la tua serie e seguire i tuoi progressi.

Crea un account