📌 history.push()
보내는쪽 component
import {useHistory} from "react-router-dom"
history.push({
pathname: "/detailboard",
state:id
});
받는쪽 component
import {useHistory,useLocation} from 'react-router-dom'
const location = useLocation();
console.log(location.state);