T
tRPC

❓-help

should we use tRPC for handling form submittion or not?

BBonsaye6/13/2023
Hey everyone, I've started using tRPC for my API endpoints and my project is based in Svelte/SvelteKit and in that eco system we have this https://superforms.rocks/ library for handling form data. I am unsure what to choose here
Tthe_riz6/13/2023
I don't know anything about that library, but taking a quick look at it, it almost seems like it is doing the exact same thing that tRPC does?
BBonsaye6/14/2023
I don't know to much of either library so I can't really say. From my understand so far, superforms library is primary meant to handle form data and not make api endpoints
Tthe_riz6/14/2023
I only mean they are the same in that both are using zod as a validator for both server and client. The actual client-ui-library part of things doesn't relate to tRPC. So for building forms, no tRPC doesn't do that, but for validating form-data, that is something tRPC would do. (I think)
BBonsaye6/14/2023
ok thanks for the help r-i-c-h

Looking for more? Join the community!

Recommended Posts
What's the benefit of using the context instead of a direct import for the database connection?I've wondered why I should use the tRPC context instead of just importing my database singleton fromUsing both tRPC React client AND tRPC React Query clientHey all! We are successfully using both the React client and the React Query client. We do this becaTRPCClientErrorlike no name propertyQuick question: Why doesn't TRPCClientErrorLike have the name property? It is called ErrorLike, so IapplyWSSHandler yells at context error in expressI used the example code from docs. My applyWSSHandler code is: ``` const handler = applyWSSHandler({How to use the errorFormatter when using an adapter?The example here uses `context.create()`, which isn't something you do when using an adapter. I donOne file per function call on the server sideI'd like to structure my server with one file per function call -- is this an antipattern? If not, dOptimistic update on infinite queryNode 18.12.1 with pnpm trpc v 10.28.1 I have the following query to render a list of posts ```tsx Creating trpc context (express server) for testing without req and res objects.I have seen a few examples of tests with next auth or t3 stack that is using next-auth under the hooDoes trpc (t3 stack) disable ssr from Nextjs?Or is the ssr just not applied to the apiGetting data as "any"For some reason, probably after update I started getting following issue. My router is no longer typWhat is error formatingI understand error handeling but what is error formating , found it in trcp docs have'nt seen that twhere does opts.path and opts.type came from ? i guess by default it only stores ctx ,next and input```ts const loggerMiddleware = middleware(async (opts) => { const start = Date.now();   const re