My code works on localhost for a split second (I see my application) and then the page become blank.
function Feed() {
const[posts,setPosts]=useState([]);
useEffect(() => {
const q = query(collection(db, "posts"))
const unsub = onSnapshot(q, (querySnapshot) => {
console.log("Data", querySnapshot.docs.map(d => doc.data()));
});
here i am returning <div>
<div className='feed'>
{/*Header */}
<div className="feed_header">
<h2>Home</h2>
</div>
.....
here is my code.
{posts.map((post)=>(
<Post displayName={post.displayName}
username={post.username}
verified={post.verified}
text={post.verified}
avatar={post.avatar}
image={post.image}
/>
this is code i am using to pass data to post