You can not have async effect. Thus you need to do following
useEffect(() => {
getPosts().then(data => setPosts(data))
}, [])
Update:
As per the updated question. I notice that you are using Server component PostCard
as a child of client component
. This is the cause of the error. All…
Top comments (0)