rocawear
Explore posts from serversTTCTheo's Typesafe Cult
•Created by rocawear on 9/24/2024 in #questions
React Query data can be undefined
Hello, any idea how could i make it so i know my data is not undefined when doing like this using react-query:
this works perfectly fine:
9 replies
TTCTheo's Typesafe Cult
•Created by rocawear on 5/3/2024 in #questions
React Query hilight new data after mutation
Hello, after i mutate, how i display new data on my table with green background? I've tried to look into queryClient but not sure from where to get the new data. For example there is getMutationCache() but cant make it work. Any help is welcome!
2 replies
TTCTheo's Typesafe Cult
•Created by rocawear on 3/16/2024 in #questions
T3 trpc v11
Hello, does T3 stack use trpc 11? Looked it and packet.json does not say version as number. Also is there coming some changes soon? Would like to use trpc on appdir and trpc documentation for v11 looks different than my newly generated T3 app
3 replies
TTCTheo's Typesafe Cult
•Created by rocawear on 12/8/2023 in #questions
react hook form filters
Hello doing filters using react-hook-form but having problems to run my update function, i would like to be able to push to url after some field changes, currently my update function does not run unless i make button for it, also any ideas/tips welcome:
More info and code on comments!
4 replies
TTCTheo's Typesafe Cult
•Created by rocawear on 6/27/2023 in #questions
How to disable App Dir?
Upgraded our app from nextjs 12 > 13. I dont want to use app dir. I get this when i launch my app:
My next.config.js even has:
4 replies
TTCTheo's Typesafe Cult
•Created by rocawear on 6/25/2023 in #questions
Prisma Schema
Hello doing feedback app, i am having problems to update my feedback info, i want to update name and questions.
On comments i show schema and current route.
6 replies
TTCTheo's Typesafe Cult
•Created by rocawear on 6/21/2023 in #questions
TypeScript problem
Hello, doing library code, took inspiration from ts-rest and trpc. I have problem, my input and output types are any. How could I make it so that those would be correct?
https://tsplay.dev/WJpnlN
Here my old version where it worked if it helps:
https://tsplay.dev/w86bVm
is my problem my Routes type?
3 replies
TTCTheo's Typesafe Cult
•Created by rocawear on 6/17/2023 in #questions
react hook form generic form
Hello, I am upgrading our form components. We are using react hook form with zod resolver.we also use chakra UI. I want to make generic components for form, inputs etc. Does somebody have good resources how I could make them as generic as possible so I could use those on all forms on our app?
2 replies
TTCTheo's Typesafe Cult
•Created by rocawear on 5/30/2023 in #questions
How to use discord.js in Nextjs app dir
Hello, I am trying to use discord.js in my app but getting alot of errors, is this even possible?:
actions.ts
12 replies
TTCTheo's Typesafe Cult
•Created by rocawear on 3/13/2023 in #questions
Turbo repo React component library Storybook problem
I am doing OSS component library on turbo repo (https://github.com/loiste-ui/loiste-ui), having some problems to install storybook to my UI packet (https://github.com/loiste-ui/loiste-ui/tree/master/packages/loiste-ui). Feel free to contribute (install storybook to UI package for now) or help here! 🙂
What I have tried:
Accepted all of those on picture (Image 1). After installation it says:
That gives me wall of errors, for example and crash
https://media.discordapp.net/attachments/663478877355507784/1084856456681103430/image.png?width=842&height=162
1 replies
TTCTheo's Typesafe Cult
•Created by rocawear on 2/25/2023 in #questions
Typescript question
I have code like this but I think my types are wrong because I cant access shape of zod schema on my class, also on comments I have some questions, any idea? I would like to be able to get schema on my database class correctly:
11 replies
TTCTheo's Typesafe Cult
•Created by rocawear on 2/24/2023 in #questions
Promise-returning function provided to attribute where a void return was expected.
Hello, doing app with t3. I am using react-hook-form and I am getting error from handleSubmit:
Promise-returning function provided to attribute where a void return was expected.eslint@typescript-eslint/no-misused-promises
I tried by doing like this but those does not work correctly:
How this should be fixed?
12 replies
tRPC sockets with react
Trying to make my React app work with socket with minimal server but getting error:
"Uncaught TypeError: Cannot destructure property 'client' of 'useContext(...)' as it is null."
at Object.useSubscription (createHooksInternal-9c1f8ad9.mjs:363:17)
at createHooksInternal-9c1f8ad9.mjs:57:29
Current code on comments!
12 replies
trpc with headless cms
Hello,
Is there any example with trpc and headless CMS or is there anypoint to use trpc for project that gets data from external source? For example existing api / headless CMS. And what would be the advantage over using for example react query and creating and getting data from api endpoint instead
2 replies
TTCTheo's Typesafe Cult
•Created by rocawear on 11/22/2022 in #questions
t3 stack - Prisma user name from user id
Hello, I have Prisma schema like this and I would like to get username for the post. Now I have userId but how I get username from that? I have username on my database so I should be able to move it to the session? Using client provider with t3 stack and on my session I have now id and email but how to save it to database(?)
My trpc mutation:
3 replies
TTCTheo's Typesafe Cult
•Created by rocawear on 11/16/2022 in #questions
tRPC and existing api
Hello, I have external API that I use on my project. I need to hide my api key so I need to create api routes as wrapper (to run serverside). Could I just use trpc for it instead of the normal api route way on nextjs? So on trpc get external api and return result and client fetches from trpc
10 replies