Skip to content

Instantly share code, notes, and snippets.

@techomoro
Created November 16, 2021 03:11
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/4f52f05fa4649c9907b4c23d569b9b2b to your computer and use it in GitHub Desktop.
Save techomoro/4f52f05fa4649c9907b4c23d569b9b2b to your computer and use it in GitHub Desktop.
import React, { useEffect } from "react";
import { useParams } from "react-router";
function Post() {
let { postSlug } = useParams();
useEffect(() => {
// Fetch post using the postSlug
}, [postSlug]);
return (
<div className="home">
<div class="container">
<h1 className="mt-5">This is a Post Title</h1>
<h6 className="mb-5">The post slug is, {postSlug}</h6>
<p>
Lorem Ipsum is simply dummy text of the printing and typesetting
industry. Lorem Ipsum has been the industry's standard dummy text ever
since the 1500s, when an unknown printer took a galley of type and
scrambled it to make a type specimen book.
</p>
<p>
Lorem Ipsum is simply dummy text of the printing and typesetting
industry. Lorem Ipsum has been the industry's standard dummy text ever
since the 1500s, when an unknown printer took a galley of type and
scrambled it to make a type specimen book.
</p>
<p>
Lorem Ipsum is simply dummy text of the printing and typesetting
industry. Lorem Ipsum has been the industry's standard dummy text ever
since the 1500s, when an unknown printer took a galley of type and
scrambled it to make a type specimen book.
</p>
</div>
</div>
);
}
export default Post;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment