Skip to content

Instantly share code, notes, and snippets.

@techomoro
Created October 6, 2021 08:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save techomoro/076ba9862fdd4305592a285a9223d122 to your computer and use it in GitHub Desktop.
Save techomoro/076ba9862fdd4305592a285a9223d122 to your computer and use it in GitHub Desktop.
// App.js
import React from "react";
import Home from "./pages/Home";
import Singlepost from "./pages/SinglePost";
import { BrowserRouter as Router, Route, Switch } from "react-router-dom";
import "react-loader-spinner/dist/loader/css/react-spinner-loader.css";
import Navigation from "./components/Navigation";
function App() {
return (
<div className="App">
<Router>
<Navigation />
<Switch>
<Route path="/" exact component={() => <Home />} />
<Route path="/:id" exact component={() => <Singlepost />} />
</Switch>
</Router>
</div>
);
}
export default App;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment