RobKnight
RobKnight
TTCTheo's Typesafe Cult
Created by camdressler on 6/27/2023 in #questions
env-nextjs error
Do you have your env variables setup? Looks like zods trying to parse to give the app typed env vars
4 replies
TTCTheo's Typesafe Cult
Created by w.ham on 4/27/2023 in #questions
How can I hit my trpc endpoint in a event handler?
yeah when interacting with ML model endpoints it feels like it should be using a query, but you definitely don't want background ML model runs lol
12 replies
TTCTheo's Typesafe Cult
Created by w.ham on 4/27/2023 in #questions
How can I hit my trpc endpoint in a event handler?
But in your scenario, you should be using a mutation
12 replies
TTCTheo's Typesafe Cult
Created by w.ham on 4/27/2023 in #questions
How can I hit my trpc endpoint in a event handler?
having a different amount of hooks will break react, it tracks the order the hooks were called to identity them- https://legacy.reactjs.org/docs/hooks-rules.html#:~:text=Only%20Call%20Hooks%20at%20the%20Top%20Level&text=Instead%2C%20always%20use%20Hooks%20at,each%20time%20a%20component%20renders. If you want to conditionally get data, call useQuery top level, and use the enabled property to control the request. Or you can use .refetch(), but this option will always cause a new request, even if your cache has data
12 replies