import React, { useState } from "react"; import { useLocation, useParams } from "react-router-dom"; interface PostState { state: { title: string; text: string; theme: string; city: string; date: string; counts: number; _id: string; user: string; }; } export function IntoPost() { const location = useLocation() as PostState; const post = location.state; // console.log(post); return (
제목: {post.title}
작성자: nickname
도시: {post.city}
테마: {post.theme}
작성일: {post.date}
조회수: {post.counts}
{post.text}
); }