First response receives no posts, even though a post is created
I have the following
If
However, when you create your first post, and you navigate back to the page that contains above code, the modal pops up 1 more time before it hides forever.
It seems like after creating the first post, the query data still seems to be empty for a few milliseconds before the posts get loaded into
Any ideas why this is happening?
useEffect function, that gets triggered whenever data changes.If
data does not contain any posts (!validData.data.length), a modal pops up asking the user to create his first post.However, when you create your first post, and you navigate back to the page that contains above code, the modal pops up 1 more time before it hides forever.
It seems like after creating the first post, the query data still seems to be empty for a few milliseconds before the posts get loaded into
data.Any ideas why this is happening?