Menu

useState Hook & Conditional Rendering

useState Hook & Conditional Rendering

A. The useState hook lets a functional component hold and update its own data over time.

This project relies on it heavily — activeTab inside both pages to control which section is showing, expandedId inside JobSeekerPage to track which job's description is open, form and error inside ApplyModal and JobForm to hold what's typed into each field, mobileMenuOpen for the slide-in menu, and jobs/applications as the shared lists both pages read from and update.

B. Conditional rendering means showing different UI depending on the current state.

In this project, the Apply modal and Job Form modal only appear when a job is selected, the Job Description section only expands when its toggle is active, the "My Applications" table only renders when that tab is active instead of "Browse Jobs", validation error text only appears after a failed submit, and both the Job Seeker and Applicants tables show a friendly empty-state message when there's nothing to list yet.