- Create T3 App -
-First Steps →
-Documentation →
-- {hello ? hello.greeting : "Loading tRPC query..."} -
-+ Create T3 App +
+First Steps →
+Documentation →
++ {hello ? hello.greeting : "Loading tRPC query..."} +
+From 71ab356168df4c24a3283061d60633cc092d496d Mon Sep 17 00:00:00 2001 From: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> Date: Sat, 13 Jul 2024 00:00:51 -0600 Subject: [PATCH] refactor: update --- t3/src/app/_components/post.tsx | 80 +++++++++++++++--------------- t3/src/app/page.tsx | 86 ++++++++++++++++----------------- 2 files changed, 83 insertions(+), 83 deletions(-) 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..."} +
+