Acessing a route api in app dir causes re-render loop.
okay, I'm just trying out the next js app routes. I'm getting a render loop when using it like this in /app/page.tsx:
Can someone please explain why this is happening and how to fix this?
Thanks
3 Replies
remove the 'use client'; at the top
now Im getting a Unhandled Runtime Error - Unexpected token H in JSON at position 0
this is my route.ts
something is causing the bad serialization