Menu

Rendering the Pages in App with Routing

Rendering the Pages in App with Routing

Finally, everything comes together in App.jsx, which acts as the root of the entire application and decides which page to show based on the URL:

File Path: ProductFeedbackApp\src\App.jsx

import { BrowserRouter, Routes, Route } from 'react-router-dom'

import CustomerSide from './pages/CustomerSide'

import AdminSide from './pages/AdminSide'



import './App.css'



function App() {

  return (

    <>

      <BrowserRouter>

        <Routes>

          <Route path="/" element={<CustomerSide />} />

          <Route path="/admin" element={<AdminSide />} />

        </Routes>

      </BrowserRouter>

    </>

  )

}



export default App

Here, CustomerSide and AdminSide are imported from the pages folder, and the whole app is wrapped inside BrowserRouter, which enables client-side routing.

Inside Routes, each Route maps a URL path to a specific page — visiting / loads CustomerSide, while visiting /admin loads AdminSide.

So App.jsx itself doesn't contain any UI logic of its own; its only job is to act as a traffic controller, deciding which page component gets rendered based on what path is typed into the browser.