김건희

[Add] Router Setting

...@@ -6202,6 +6202,14 @@ ...@@ -6202,6 +6202,14 @@
6202 "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", 6202 "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz",
6203 "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==" 6203 "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw=="
6204 }, 6204 },
6205 + "history": {
6206 + "version": "5.3.0",
6207 + "resolved": "https://registry.npmjs.org/history/-/history-5.3.0.tgz",
6208 + "integrity": "sha512-ZqaKwjjrAYUYfLG+htGaIIZ4nioX2L70ZUMIFysS3xvBsSG4x/n1V6TXV3N8ZYNuFGlDirFg32T7B6WOUPDYcQ==",
6209 + "requires": {
6210 + "@babel/runtime": "^7.7.6"
6211 + }
6212 + },
6205 "hoopy": { 6213 "hoopy": {
6206 "version": "0.1.4", 6214 "version": "0.1.4",
6207 "resolved": "https://registry.npmjs.org/hoopy/-/hoopy-0.1.4.tgz", 6215 "resolved": "https://registry.npmjs.org/hoopy/-/hoopy-0.1.4.tgz",
...@@ -10077,6 +10085,23 @@ ...@@ -10077,6 +10085,23 @@
10077 "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.11.0.tgz", 10085 "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.11.0.tgz",
10078 "integrity": "sha512-F27qZr8uUqwhWZboondsPx8tnC3Ct3SxZA3V5WyEvujRyyNv0VYPhoBg1gZ8/MV5tubQp76Trw8lTv9hzRBa+A==" 10086 "integrity": "sha512-F27qZr8uUqwhWZboondsPx8tnC3Ct3SxZA3V5WyEvujRyyNv0VYPhoBg1gZ8/MV5tubQp76Trw8lTv9hzRBa+A=="
10079 }, 10087 },
10088 + "react-router": {
10089 + "version": "6.3.0",
10090 + "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.3.0.tgz",
10091 + "integrity": "sha512-7Wh1DzVQ+tlFjkeo+ujvjSqSJmkt1+8JO+T5xklPlgrh70y7ogx75ODRW0ThWhY7S+6yEDks8TYrtQe/aoboBQ==",
10092 + "requires": {
10093 + "history": "^5.2.0"
10094 + }
10095 + },
10096 + "react-router-dom": {
10097 + "version": "6.3.0",
10098 + "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.3.0.tgz",
10099 + "integrity": "sha512-uaJj7LKytRxZNQV8+RbzJWnJ8K2nPsOOEuX7aQstlMZKQT0164C+X2w6bnkqU3sjtLvpd5ojrezAyfZ1+0sStw==",
10100 + "requires": {
10101 + "history": "^5.2.0",
10102 + "react-router": "6.3.0"
10103 + }
10104 + },
10080 "react-scripts": { 10105 "react-scripts": {
10081 "version": "5.0.1", 10106 "version": "5.0.1",
10082 "resolved": "https://registry.npmjs.org/react-scripts/-/react-scripts-5.0.1.tgz", 10107 "resolved": "https://registry.npmjs.org/react-scripts/-/react-scripts-5.0.1.tgz",
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
13 "nodemon": "^2.0.16", 13 "nodemon": "^2.0.16",
14 "react": "^18.1.0", 14 "react": "^18.1.0",
15 "react-dom": "^18.1.0", 15 "react-dom": "^18.1.0",
16 + "react-router-dom": "^6.3.0",
16 "react-scripts": "5.0.1", 17 "react-scripts": "5.0.1",
17 "web-vitals": "^2.1.4" 18 "web-vitals": "^2.1.4"
18 }, 19 },
......
1 import './App.css'; 1 import './App.css';
2 import RegisterPage from './component/views/RegisterPage/RegisterPage'; 2 import RegisterPage from './component/views/RegisterPage/RegisterPage';
3 import LoginPage from './component/views/LoginPage/LoginPage'; 3 import LoginPage from './component/views/LoginPage/LoginPage';
4 +import { Route, Routes } from 'react-router-dom';
4 5
5 function App() { 6 function App() {
6 return ( 7 return (
7 <div> 8 <div>
8 - <LoginPage /> 9 + <Routes>
10 + <Route exact path = "/login" element = {<LoginPage/>}/>
11 + <Route exact path = "/register" element = {<RegisterPage/>}/>
12 + </Routes>
9 </div> 13 </div>
10 ); 14 );
11 } 15 }
......
...@@ -3,11 +3,14 @@ import ReactDOM from 'react-dom/client'; ...@@ -3,11 +3,14 @@ import ReactDOM from 'react-dom/client';
3 import './index.css'; 3 import './index.css';
4 import App from './App'; 4 import App from './App';
5 import reportWebVitals from './reportWebVitals'; 5 import reportWebVitals from './reportWebVitals';
6 +import { BrowserRouter } from 'react-router-dom';
6 7
7 const root = ReactDOM.createRoot(document.getElementById('root')); 8 const root = ReactDOM.createRoot(document.getElementById('root'));
8 root.render( 9 root.render(
9 <React.StrictMode> 10 <React.StrictMode>
10 - <App /> 11 + <BrowserRouter>
12 + <App />
13 + </BrowserRouter>
11 </React.StrictMode> 14 </React.StrictMode>
12 ); 15 );
13 16
......