Skip to main content

Function Components and Project Structure

Learn Function Components and Project Structure (Phase 2 · JSX and Components (Essential), ReactJS) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.

Components are functions that return UI • A component is a function whose name starts with a capital letter and returns JSX (or null ). Class components are legacy; write function components with hooks. • Build the UI as a tree of small components: App → Header , ProductList → ProductCard . Each should do one thing. • One component per file, named exports or default export, file name equal to the component name.

More lessons in Phase 2 · JSX and Components (Essential)