Intermedio
4 ottobre 2026

Trova il bug: React Native

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

tsx
1import { Alert } from 'react-native'
2
3type Status = 'idle' | 'loading' | 'success' | 'error'
4
5export function notify(status: Status) {
6  switch (status) {
7    case 'loading':
8      Alert.alert('Loading...')
9    case 'success':
10      Alert.alert('Done!')
11      break
12    case 'error':
13      Alert.alert('Failed')
14      break
15    default:
16      break
17  }
18}

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