carnegiepilled
Explore posts from serversWhy is my tRPC + Next 14 (app router) data fetching pattern not refreshing the UI?
Goals of this post:
- to know why my UI is not refreshing after i mutate the backend
- to learn a better data mutation and update pattern
My code:
Client component
tRPC route:
As you can see, the workflow is:
1) make a mutation on FE that toggles the docs.isLocked column
2) fetch the row on the backend to get the current state of said column
3) toggle mutation
4) fetch it after to get new state (mySql doesn't do returning updates)
5) refresh route (not working)
My questions
1. Why is my UI not updating? router.refresh and revalidatepath do nothing
4 replies
TTCTheo's Typesafe Cult
•Created by carnegiepilled on 10/27/2023 in #questions
MDX not rendering custom components in Next
2 replies