tRPC middleware
I tried doing what I saw here, but since t3 is typescript it doesn’t allow null. Has anyone done something like this?

4 Replies
Typescript allows null idk what you mean
Jack is literally using typescript in this video?
This is for express too?
Why would you do this with the t3 stack
I attempted the null just like his using the t3 stack , but it just says createContext can't be of that type. I like seeing the endpoints have json objects, so just wanted to try it ou
this should work

you can see on line 8 on the right, the type of createTRPCContext gets inferred
so if you leave that unchanged, but change context to
() => {}
or whatever in your route handler, the types will be mismatched and it will complain