Mid-Level
October 4, 2026Spot the bug: React Native
One snippet. Find the bug, or prove there isn't one.
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}Click the lines that carry the problem.
Your verdict
One attempt per day. The answer shows up right after.
Keep your streak
Create an account to keep your streak and track your progress.