🐸 설치 라이브러리
yarn create react-app final-sample --template typescript
yarn add react-query recoil @mui/material @mui/icons-material tailwindcss clsx react-router-dom
yarn tailwindcss init
📁 shared / Router.tsx
.tsx
로 지정해야 한다.import React from 'react';
import { BrowserRouter, Route, Routes } from 'react-router-dom';
import Home from '../pages/Home';
import Signin from '../pages/SignIn';
import SignUp from '../pages/SignUp';
const Router = () => {
return (
<BrowserRouter>
<Routes>
<Route path="/" element={<Home />} />
<Route path="/signin" element={<Signin />} />
<Route path="/signup" element={<SignUp />} />
</Routes>
</BrowserRouter>
);
};
export default Router;
📁 App.tsx
import './App.css';
import Router from './shared/Router';
import React from 'react';
function App() {
return (
<Router />
);
}
export default App;
📁 App.tsx
import React from 'react';
import { Link } from 'react-router-dom';
const Home = () => {
return (
<div>
<Link to={`/signin`}>SIGN IN</Link>
<br />
<Link to={`/signup`}>SIGN UP</Link>
</div>
);
};
export default Home;