const Post = () => {
const router = useRouter();
const slug = router.query.postslug;
const currentPost = PostData.find((post) => post.slug === slug);
return (
currentPost.content
)
}
export default Post;
Server Error TypeError: Cannot read properties of undefined (reading 'content')
Below is the array of objects
const PostData = [
{
id:1,
slug:...,
content:...
}
]