79216926

Date: 2024-11-23 01:01:08
Score: 1
Natty:
Report link

Here is how you could pass the post using state.

<Link to={{pathname: `/blog/${post.id}`}} state={{post: post}}>Read More...</Link>

To access it from the destination component:

import { useLocation } from "react-router-dom";

const location = useLocation();
console.log(location.state.post)
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: ALFRED OKORONKWO