Skip to content

Instantly share code, notes, and snippets.

@techomoro
Last active February 10, 2022 21:49
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save techomoro/32e2f5d954df7b7fbeefccab8636c1be to your computer and use it in GitHub Desktop.
Save techomoro/32e2f5d954df7b7fbeefccab8636c1be to your computer and use it in GitHub Desktop.
import React from "react";
import ReactDOM from "react-dom";
import "./index.css";
import * as serviceWorker from "./serviceWorker";
import { BrowserRouter as Router, Route, Routes } from "react-router-dom";
import {
Navigation,
Footer,
Home,
About,
Contact,
Blog,
Posts,
Post,
} from "./components";
ReactDOM.render(
<Router>
<Navigation />
<Routes>
<Route path="/" element={<Home />} />
<Route path="/about" element={<About />} />
<Route path="/contact" element={<Contact />} />
<Route path="/blog" element={<Blog />}>
<Route path="" element={<Posts />} />
<Route path=":postSlug" element={<Post />} />
</Route>
</Routes>
<Footer />
</Router>,
document.getElementById("root")
);
serviceWorker.unregister();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment