Theo's Typesafe Cult

TTC

Theo's Typesafe Cult

Join the community to ask questions about Theo's Typesafe Cult and get answers from other members.

Join

How to create never expire refresh token?

I want to add tokens for developers to access my API. How can I do it with NextAuth, can it create refresh token that never expire?

How to handle key press events in React?

Anyone have good resources for how to handle a key left or right event in React? I see a lot of outdated or not optimal solutions that use document.

Two repos one Prisma. Lets Merge.

Good morning guys. I just started merging two repos into a Monorepo and have no idea what im doing :-). Would love some help. I have two repos, FM and LH. FM is t3-app and LH is basically pure ts-node. They share a prisma instance. I just copied the whole LH into FM as a subdirectory. Nothing changed in the FM git status. ...

How are you supposed to use local fonts in taliwindcss

I'm not currently using the t3 stack, but how are you supposed to use locally downloaded fonts in tailwindcss. I tried to look at the docs but they don't include anything on local fonts and an online search leads me to outdated ones....

Always redirect to same route when logging in

Hey, I'm using the full T3 Stack. How do I tell NextAuth to redirect to a certain route when logging in/signing up? Right now, it redirects to the route I was on when I logged out.

Can I pass refetch as a prop?

Title basically.. The thing is that I am fetching all of my items in component#1, I use them there and I also pass them as a prop to component#2, there I can create a new item. thing is that I would like to use the refetch function in component#2 that comes along the useQuery (which is in component#1). Is it even something I should do or is it a bad design choice on my end? How do I approach this issue?...

TRPC & ReactQuery: How to check if logged in

Hi Guys, how would you check if the current User is logged in? I tried creating a Query which would return a Boolean, extract it into a Component and then conditionally render the Child or a NavitgateTo Component but that resulted in endless re-renders. ...

Copying the docs but got an error

Hi! Anyone know how I can fix this error?

og meta tags

Hey guys what's the best way to check og meta tags for video on localhost, especially for twitter cards?

What is the fastest way to get up and running with TypeScript and Node?

Hello! I need to write a stateful socket.io server that I am going to deploy to railway. I want to use typescript, however it seems that if you are not using a front end framework there is no great way to get up and running quickly with typescript. Anyone have any recommendations? Thanks!...

Form Submiting Doesn't Work, It refetches getStaticProps instead

I have simple form with some inputs, I call submitHander function and just testing if it calls onSubmit ```ts const submitHandler = (e: FormEvent<HTMLFormElement>) => { e.preventDefault();...

How to get context type of protectedProcedure?

I want to keep my logic outside of the routes by using functions and just calling them in the router. Is there a way to get the type of the context with the procedures applied, i.e., I want to get types ProtectedProcedureContext and PublicProcedureContext to use as input types for a function. How to?

Updating Context in an endpoint

How do I update the values in the ctx variable that is passed to the endpoint?

Why not to use only 1 token in JWT?

So we can create only 1 token which we will store in cookie. Let's call it bi token. So bi token will act like refresh token + have checkTime field which will act like expiration of access token. A client don't worry about storing access token. At the same time it's secure, because token version will be checked on the server each checkTime + regenerated without additional request. Maybe I miss something, that's why I ask.

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: ```ts cd packages/loiste-ui ...

Recommendation on the tailwind pattern to style this footer gracefully

Here is what I'm working with atm and its honestly just not looking very good. ```html <div className="align-center mx-auto flex flex-col justify-center border border-button bg-white py-8 pt-12"> <div className="flex basis-11/12 justify-evenly">...

How to refactor to create-t3-app?

I have the following setup. I have a Django backend and a Nextjs frontend. In Next, I replicate my Django models and have api functions for accessing the api endpoints from Django. How would I refactor this setup to an app that's created with create-t3-app Product/index.ts...

jotai-trpc and create-t3-app

Hi! Can anybody help to implement jotai-trpc? When I try to shift 'createTRPCNext' to 'createTRPCJotai' there is TS error I also tried edit api to edit 'createTRPCJotai' like in documentation but, when I got error in _app - because 'createTRPCJotai', don't have 'withTRPC' func May be somebody have working example? ...

Modal in a list

Hi i'd like to ask for best practice for these kind of implementation lets say i have a CRUD feature that the list could go on to hundreds each row have their own delete button and when clicked would show up Delete Modal ...

Dev stack for almost completely static website

Hi 👋 I'm about to build a very small, 1 page website, with no dynamic data or any reactivity really. Just a site to display some info and put a contant number. Maybe in the future add a small form and minor reactivity, but not for now. My question is, what is the best way to approach this quick project? I think most frameworks would be overkill here, what's best?...