김대휘

라우팅 설정

......@@ -10,6 +10,7 @@
"@testing-library/user-event": "^7.1.2",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-router-dom": "^5.2.0",
"react-scripts": "3.4.1"
},
"scripts": {
......
import React from "react";
import NavBar from "./components/NavBar.js";
import BodyLayout from "./components/BodyLayout.js";
import React from 'react';
import LandingPage from './pages/LandingPage.js';
import MainPage from './pages/MainPage.js';
import {
BrowserRouter as Router,
Switch,
Route
} from "react-router-dom";
function App() {
return (
<Router>
<>
<NavBar />
<BodyLayout />
<Switch>
<Route exact path="/" component={LandingPage}/>
<Route exact path="/main" component={MainPage}/>
</Switch>
</>
</Router>
);
}
......
import React from "react";
import NavBar from "../components/NavBar.js";
import BodyLayout from "../components/BodyLayout.js";
function App() {
return (
<>
</>
);
}
export default App;
import React from "react";
import NavBar from "../components/NavBar.js";
import BodyLayout from "../components/BodyLayout.js";
function App() {
return (
<>
<NavBar />
<BodyLayout />
</>
);
}
export default App;
This diff is collapsed. Click to expand it.