This is a demonstration of a traditional Multi-Page Application (MPA) to help you understand the difference between MPA and SPA (Single Page Application) approaches before diving into React.
By exploring this demo, you'll understand:
- How traditional websites work with full page reloads
- The limitations and problems of Multi-Page Applications
- Why Single Page Applications (like React apps) provide a better user experience
- The key problems that React solves
-
Using VS Code Live Server:
- Right-click
index.html - Select "Open with Live Server"
- Right-click
-
Using Python:
python -m http.server 8000 # Then open http://localhost:8000 -
Using Node.js:
npx serve
Follow these steps to experience the limitations of traditional MPAs:
- Open
index.htmlin your browser - Notice the timestamp at the top of the page
- Type something in the input field
- Click to navigate to the About page
- What happened?
- You saw a white flash (full page reload)
- The timestamp changed (new page was loaded from scratch)
- Your input is gone (all state was lost)
- Open DevTools (F12 or right-click → Inspect)
- Go to the Network tab
- Navigate between pages
- What do you see?
- Every navigation downloads the entire HTML, CSS, and JavaScript again
- Multiple network requests for resources that haven't changed
- Wasted bandwidth and slower performance
- Navigate to the Products page
- Click the counter button several times
- Navigate away to another page, then come back
- What happened?
- The counter reset to 0
- All JavaScript state was lost on navigation
- Navigate to the Contact page
- Start filling out the form with your information
- Click any navigation link
- What happened?
- Your form data disappeared
- Frustrating user experience!
Through this demo, you've experienced these MPA limitations:
- Full page reload on every navigation
- All state is lost when navigating (JavaScript, form inputs, counters, etc.)
- Visible flash/blink between pages
- Network overhead - re-downloading the same resources repeatedly
- Poor user experience - slow, clunky navigation
- Lost data - form inputs and user interactions don't persist
React and other modern frameworks create Single Page Applications (SPAs) that solve these issues:
- Partial updates - Only the content that changes gets updated
- Persistent state - Data stays in memory during navigation
- Smooth navigation - No page reloads, no white flash
- Better performance - Resources loaded once, minimal network requests
- App-like experience - Fast, responsive, modern UX
- Preserved data - Form inputs and state persist across navigation
| Feature | MPA (This Demo) | SPA (React) |
|---|---|---|
| Navigation | Full page reload | Partial DOM update |
| Speed | Slower (reload delay) | Faster (instant) |
| State Management | Lost on navigation | Persists in memory |
| User Experience | Flash/blink | Smooth transitions |
| Network Requests | Multiple, repeated | Minimal, optimized |
| Form Data | Lost | Preserved |
| Feels Like | Traditional website | Native app |
- Traditional MPAs reload the entire page on every navigation, which is slow and loses all state
- React SPAs update only what changes, keeping the app fast and state intact
- User experience matters - the difference between MPA and SPA is noticeable and significant
- Modern web apps use SPAs for a reason - better performance, UX, and developer experience
Now that you understand the problems with traditional websites, you're ready to learn how React solves them! Continue with the Day 1 exercises to start building your first React components and experience the SPA approach firsthand.