라우터 사용하기

jjunjjinpapa·2021년 8월 31일
0

설치

yarn add react-router-dom
yarn add @types/react-router-dom

index.tsx

import { BrowserRouter, Route } from 'react-router-dom';
import DashboardPage from './pages/DashboardPage';
import LoginPage from './pages/LoginPage';

<BrowserRouter>
  <Route path="/" exact component={DashboardPage} />
  <Route path="/login" component={LoginPage} />
</BrowserRouter>
profile
개발자

0개의 댓글