diff --git a/src/LecueNote/page/LeceuNotePage/index.tsx b/src/LecueNote/page/LeceuNotePage/index.tsx index c8ad7184..2d01a324 100644 --- a/src/LecueNote/page/LeceuNotePage/index.tsx +++ b/src/LecueNote/page/LeceuNotePage/index.tsx @@ -36,7 +36,7 @@ function LecueNotePage() { const postMutation = usePostLecueNote(); const location = useLocation(); - const { bookId } = location.state; + const { bookId } = location.state || {}; const handleClickCategory = ( e: React.MouseEvent, diff --git a/src/StickerPack/page/StickerPack/index.tsx b/src/StickerPack/page/StickerPack/index.tsx index a0b4c859..59d0059a 100644 --- a/src/StickerPack/page/StickerPack/index.tsx +++ b/src/StickerPack/page/StickerPack/index.tsx @@ -17,7 +17,7 @@ function StickerPack() { const navigate = useNavigate(); const location = useLocation(); - const { bookId } = location.state; + const { bookId } = location.state || {}; const [selectedStickerData, setSelectedStickerData] = useState({ stickerId: 0,