No sé que hice mal, me da error en la línea 18, me aparecen el siguiente mensaje "React Hook useEffect has a missing dependency: 'navigate'. Either include it or remove the dependency array. Así está el código:
import { useState, useEffect } from "react" import "../assets/css/componentes/card.css" import { useParams, useNavigate } from "react-router-dom" import { buscar } from "../api/api"
const Post = ({ url }) => {
const [post, setPost] = useState({})
const {id} = useParams()
const navigate = useNavigate()
useEffect(() => {
buscar(`/posts/${id}`, setPost).catch(() => {
navigate("/not-found")
})
}, [id])
return (
<main className="container flex flex--center">
<article className="card post">
<h2 className="post-card__title">{post.title}</h2>
<p className="text__card">{post.body}</p>
</article>
</main>
)
}
export default Post