import { Routes, Route, Outlet } from "react-router-dom";
import Home from "./components/Home/Home";
import Card from "./components/Card/Card";
import Header from "./components/Header/Header";
import AllProducts from "./components/AllProducts/AllProducts";
function App() {
return (
<>
<Header />
<Outlet />
<Routes>
<Route path="/" element={<Home />}>
{}
<Route path="products" element={<AllProducts />} />
</Route>
</Routes>
</>
);
}
export default App;
Home 컴포넌트
function Home() {
return (
<Card>
<h1>Product</h1>
<Outlet />
</Card>
);
}