locusdagraca
locusdagraca
TTCTheo's Typesafe Cult
Created by locusdagraca on 7/25/2023 in #questions
fetching dynamic data in layout, not page
Hello hello. In my nextjs 13 project, my layout.tsx use a client side component (navbar) who also show either the user is connected or not (dynamic). By definition, the layout does NOT re render. So impossible to see the up to date data on my navbar. It only shows after a reload of the page. And no router.refresh() doesnt do the trick. How would you fix it?
5 replies
TTCTheo's Typesafe Cult
Created by locusdagraca on 7/11/2023 in #questions
How to upload files from server side?
I am using nextjs 13. Lets take this example: User upload a video -> video uploaded to UT -> i download back the video on server to modify it (with ffmpeg for example) -> need to upload the new video to UT from server. How can i do the last step and upload my file from server using UT? The doc just say that we can GET and POST the "api/uploadthing" but its not clear how to pass a file and the wanted endpoint like this. From client-side it's pretty well explained.
2 replies