Code Room
Code reviewHard
Question
Review this React TypeScript tab content loader.
What a strong answer looks like
Separate real bugs from style. Rank issues by severity, point at the root cause rather than the symptom, and suggest a concrete fix — specific and kind.
Learn the concepts
function TabContent({ tab }: { tab: string }) { const [body, setBody] = useState(''); useEffect(() => { let active = true; fetch(`/api/tabs/${tab}`) .then((r) => r.text()) .then((t) => setBody(t)); return () => { active = false; }; }, [tab]); return <div>{body}</div>;}Run or narrate your approach, then ask the coach.