.hatulapro
Explore posts from serversTTCTheo's Typesafe Cult
•Created by Revaycolizer on 4/19/2023 in #questions
Passing data as props in form function
You can create the handler function with another function:
Or define it inline (if possible):
12 replies
TTCTheo's Typesafe Cult
•Created by fotoflo on 2/20/2023 in #questions
should i just make a REST api for that?
useQuery
doesn't call the server on every render. It only calls when it "needs" to (depending on how you configure it). But if you only want to make a request on an event, that's what useMutation
is for9 replies
TTCTheo's Typesafe Cult
•Created by Chadbek on 1/15/2023 in #questions
Modularized Imports
You can't customize it too much, but
{{ kebabCase member }}
should do the trick4 replies
TTCTheo's Typesafe Cult
•Created by WOLG on 1/10/2023 in #questions
Benefits of NextPage type
NextPage allows you to set
getInitialProps
on your page (https://nextjs.org/docs/api-reference/data-fetching/get-initial-props). Passing a generic type to it will also force getInitialProps to return that type.
It probably doesn't matter if you're not using getInitialProps though. Personally I just use it to make it clear that a component a page2 replies
TTCTheo's Typesafe Cult
•Created by Prabhath on 1/5/2023 in #questions
Can anyone share how to infer type of class member of trpcresponse
Try wrapping it with NonNullable to only refer to the object you're returning
9 replies
TTCTheo's Typesafe Cult
•Created by Prabhath on 1/5/2023 in #questions
Can anyone share how to infer type of class member of trpcresponse
You can simply do:
9 replies
TTCTheo's Typesafe Cult
•Created by Knox on 12/31/2022 in #questions
Get session data inside a mutation
It probably doesn't apply in this case, but you can still access
ctx.session?.user
in public procedures, just make sure the user is not undefined. It can be useful in some situations19 replies
TTCTheo's Typesafe Cult
•Created by Leke on 11/27/2022 in #questions
'paginationRange.length' is possibly 'undefined'.ts(18048)
when
paginationRange
is falsey, paginationRange.length
returns undefined as well. Then you are comparing undefined to a number, which doesn't make sense (JS will always return false, but TS does not allow that comparison).4 replies
TTCTheo's Typesafe Cult
•Created by Simvolick on 11/23/2022 in #questions
No Overload matches this call with nextAuth mapping
providers
can be null which would throw an error3 replies
TTCTheo's Typesafe Cult
•Created by taco is a friend of bluey 🇵🇸🏴 on 10/22/2022 in #questions
Getting an error saying `TypeError movies.map is not a function`
Did you make sure to pass the props to your component? In _app.tsx you should have something like this:
9 replies