22.09.27 01:28 작성
·
943
3
20강에서
Router 예제 복붙 시 오류안나는 최종본입니다 !!
import React from "react";
import {
Route,
Routes,
BrowserRouter
} from "react-router-dom";
import LandingPage from "./components/views/LandingPage/LandingPage";
import LoginPage from "./components/views/LoginPage/LoginPage";
import RegisterPage from "./components/views/RegisterPage/RegisterPage";
function App() {
return (
<BrowserRouter>
<div>
{/* A <Switch> looks through its children <Route>s and
renders the first one that matches the current URL. */}
<Routes>
<Route exact path="/" element={LandingPage()}/>
<Route exact path="/login" element={LoginPage()}/>
<Route exact path="/register" element={RegisterPage()}/>
</Routes>
</div>
</BrowserRouter>
);
}
export default App;