<div className="navbar">
<Link to="/createpost">새 글 작성</Link>
<Link to="/">홈</Link>
</div>
/* NAVBAR */
.navbar {
width: 100%;
height: 70px;
background-color: dodgerblue;
display: flex;
align-items: center;
font-family: Arial, Helvetica, sans-serif;
}
.navbar a {
margin-left: 20px;
text-decoration: none;
color: white;
}
Post.js
in pages folder (Client)import Post from './pages/Post';
<div className="navbar">
<Link to="/">홈</Link>
<Link to="/createpost">새 글 작성</Link>
</div>
<Route path="/post/:id" exact component={Post} />
.post
import { useHistory } from 'react-router-dom';
let history = useHistory()
{id}
in Post.js
import { useParams } from 'react-router-dom';
import React, { useEffect } from "react";
import axios from 'axios';
and use useEffect
router.get('/byId/:id', async (req, res) => {
const id = req.params.id;
const post = await Posts.findByPk(id);
res.json(post);
});
(./pages/Post)(Client)
useState
const [postObject, setPostObject] = useState({});
setPostObject(response.data)
return <div>{postObject.postText}</div>
left side will be individual post
right side will be comment place
id 1
id 3
for now, when I clicked Create Post , I was still in the page
so let's make that work how do we redirect based on if we clicked on the create post button
import { useHistory } from 'react-router-dom';
let history = useHistory();
history.push('/');
onSubmit()
when I create a new post, it should redirect us to the 홈 which is just the slash.
when i clicked button?
redirect us to the 홈 page
Amazing article two way radio headset efficient device that work best in all condition .
https://foro.zendalibros.com/forums/users/swatisingh/
https://admin.phacility.com/p/nightangels/
https://participer.ge.ch/profiles/swatisingh/activity?locale=en
https://www.producthunt.com/@swati_singh21
https://wakelet.com/@SWATISINGH67
https://www.vingle.net/swatisinghiam1
https://coub.com/swati-singh
https://thegadgetflow.com/user/swatisinghiam/
https://www.b-webdesign.org/dir-wowonder/NightAngels
https://lifeinsys.com/user/nightangels
https://atlanta.bubblelife.com/users/swatisinghia_h286154
https://www.tetongravity.com/community/profile/swatisingh/
https://leetcode.com/swatisinghiam/
https://forum.velovert.com/user/323686-swatisingh/#
https://user.linkdata.org/user/SWATI_SINGH/work
https://rpgplayground.com/members/swatisingh/profile/
http://www.trainingpages.com/author/nightangels/
https://www.inzercia.rimava.sk/author/swatisingh/
https://gettogether.community/profile/50564/
Hey Buddies, are you feel alone don't worry i am here to solve your every querry related to your life just click on my sites.
https://www.atoallinks.com/2022/lucknow-escorts-fun-loving-call-girls/
https://www.spegcs.org/forums/c/general-topics/how-to-get-the-best-value-from-your-membership/why-to-date-online-when-you-have-more-option/
https://xiglute.com/forums/topic/44771/lucknow-call-girls-are-more-energetic/
https://www.bitrated.com/lucknowcalgirl
https://www.noteflight.com/profile/97ef17b64cd807e2441f182415acd8bcfc4ffeb5
https://learn.acloud.guru/profile/callgirl
https://callgirl.contently.com/
https://www.passivehousecanada.com/members/callgirl/
https://sylpheed.sraoss.jp/redmine/issues/3459
https://varecha.pravda.sk/profil/saipallavi/o-mne/
https://hotcallgirl.mystrikingly.com/
https://www.amirite.com/user/callgirl
http://www.newdirt.org/forums/users/saipallavi/
https://www.acreauburn.com/profile/itssaipallavi/profile
https://www.twilightcreationsinc.com/profile/itssaipallavi/profile
https://www.nmgs.org/profile/itssaipallavi/profile
https://www.yesflowers.ie/profile/itssaipallavi/profile
https://bloomforwomen.com/forums/users/saipallavi/
https://mount-pearl.adposta.com/chandigarh-call-girls-786135
https://www.khedmeh.com/wall/blogs/post/18141
https://pharmahub.org/members/19606/profile
https://www.veloatelier.co.uk/profile/itssaipallavi/profile
https://uconnect.ae/saipallavi