- Create T3 App -
-First Steps →
-Documentation →
-- {hello ? hello.greeting : "Loading tRPC query..."} -
-+ Create T3 App +
+First Steps →
+Documentation →
++ {hello ? hello.greeting : "Loading tRPC query..."} +
+diff --git a/t3/src/app/_components/post.tsx b/t3/src/app/_components/post.tsx index b6b5cb4..013e7bb 100644 --- a/t3/src/app/_components/post.tsx +++ b/t3/src/app/_components/post.tsx @@ -5,46 +5,46 @@ import { useState } from "react"; import { api } from "@/trpc/react"; export function LatestPost() { - const [latestPost] = api.post.getLatest.useSuspenseQuery(); + const [latestPost] = api.post.getLatest.useSuspenseQuery(); - const utils = api.useUtils(); - const [name, setName] = useState(""); - const createPost = api.post.create.useMutation({ - onSuccess: async () => { - await utils.post.invalidate(); - setName(""); - }, - }); + const utils = api.useUtils(); + const [name, setName] = useState(""); + const createPost = api.post.create.useMutation({ + onSuccess: async () => { + await utils.post.invalidate(); + setName(""); + }, + }); - return ( -
Your most recent post: {latestPost.name}
- ) : ( -You have no posts yet.
- )} - -Your most recent post: {latestPost.name}
+ ) : ( +You have no posts yet.
+ )} + +- {hello ? hello.greeting : "Loading tRPC query..."} -
-+ {hello ? hello.greeting : "Loading tRPC query..."} +
+