this is not server actions. You are still calling the third Party REST API from the client components. If this was a true server actions then the network tab would show traffic to localhost not the third-party API.
I sorta agree. `getPosts` is called from the server when called from the server component `Home` in `src/app/page.tsx`, but is called from a client component as @MartinRojas mentioned when the "load more" button is clicked. Luckily, `getPosts` can be turned into a server action simply by adding 'use server' at the top of the `get-posts.ts` file. Then, `getPosts` would be called from the server even when called by a client component. (You can confirm by console-logging and looking at where the logs appear.)
When I try this I get an error that tells me: async/await is not yet supported in Client Components, only Server Components. Any ideas what I might have done differently to you?
this is not server actions. You are still calling the third Party REST API from the client components. If this was a true server actions then the network tab would show traffic to localhost not the third-party API.
I sorta agree.
`getPosts` is called from the server when called from the server component `Home` in `src/app/page.tsx`, but is called from a client component as @MartinRojas mentioned when the "load more" button is clicked.
Luckily, `getPosts` can be turned into a server action simply by adding 'use server' at the top of the `get-posts.ts` file. Then, `getPosts` would be called from the server even when called by a client component. (You can confirm by console-logging and looking at where the logs appear.)
Excellent! Straight to the point!
When I try this I get an error that tells me: async/await is not yet supported in Client Components, only Server Components. Any ideas what I might have done differently to you?