I am getting missing dependency warning.
React Hook useEffect has a missing dependency: 'fetchFeatured'. Either include it or remove the dependency array
My Code
useEffect(() => {
const fetchFeatured = () => {
onSnapshot(faeturedCollectionRef, (snapshot) =>
setFeatured(snapshot.docs.map((doc) => ({ ...doc.data(), id: doc.id })))
)
}
fetchFeatured();
}, [])
I have used empty array for avoiding loop.