Build a Simple Next.js App Using the App Directory (App Router)
📖 Scenario: You are creating a small website homepage using Next.js with the new App Router feature. This new way organizes pages inside the app folder instead of the old pages folder.The website will show a welcome message and a list of three favorite fruits.
🎯 Goal: Build a Next.js app using the app directory. Create a homepage that displays a heading and a list of fruits using React components and the App Router conventions.
📋 What You'll Learn
Create an
app folder with a page.tsx fileDefine a React functional component named
HomePage inside page.tsxUse a constant array
fruits with exactly these strings: "Apple", "Banana", "Cherry"Render a heading
<h1> with the text "Welcome to My Fruit Site"Render an unordered list
<ul> showing each fruit from the fruits array as a list item <li>Export the
HomePage component as the default export💡 Why This Matters
🌍 Real World
Next.js App Router is the modern way to build React apps with file-based routing and server components, used in many professional web projects.
💼 Career
Understanding the app directory and how to create pages with React components is essential for frontend developers working with Next.js in real-world jobs.
Progress0 / 4 steps