Frontendx
README.md
SOLUTION.md
main.tsxentry
App.tsx
App.css
index.html
vite.config.ts
Installed
react@^19.2.0
react-dom@^19.2.0

Tab Component with Lazy Loading — Tabbed UI That Defers Rendering of Panel Content Until Tab Becomes Visible

Prompt

Build a Tab component that renders a set of clickable tab headers and a content panel below. The key variation is lazy loading: the content of each tab panel should only be fetched or rendered when that tab is first clicked — not on initial mount. Once a tab's content has been loaded it should be cached and not re-fetched on subsequent visits to that tab. Implement two approaches: (1) using React Context to share active tab state, (2) using normal state management. Show a Loading... placeholder while content is being fetched. This question was asked in Atlassian's Principal Engineer (P60) interview and Okta's senior frontend interview.

Track which tabs have been loaded in state using a Set or object of tab IDs.
Test Results

Tab Component with Lazy Loading — Tabbed UI That Defers Rendering of Panel Content Until Tab Becomes Visible

Build a Tab component that renders a set of clickable tab headers and a content panel below. The key variation is lazy loading: the content of each tab panel should only be fetched or rendered when that tab is first clicked — not on initial mount. Once a tab's content has been loaded it should be cached and not re-fetched on subsequent visits to that tab. Implement two approaches: (1) using React Context to share active tab state, (2) using normal state management. Show a Loading... placeholder while content is being fetched. This question was asked in Atlassian's Principal Engineer (P60) interview and Okta's senior frontend interview.