prakhar_goel
TTCTheo's Typesafe Cult
•Created by swikarrr on 7/8/2023 in #questions
TypeScript
You can try this https://www.totaltypescript.com/tutorials
6 replies
TTCTheo's Typesafe Cult
•Created by ayush_uidev on 7/8/2023 in #questions
Zod type email string and number message not working correctly
if input type is text you will phone number in string format you need to convert it transform it to a number before checking it
4 replies
TTCTheo's Typesafe Cult
•Created by c1ub on 5/24/2023 in #questions
Typescript wizards needed! Circular dependency with Zod inferred schema type withing superRefine()
does this not work for your use case
5 replies
TTCTheo's Typesafe Cult
•Created by vitor markis 🎈 on 5/17/2023 in #questions
persist user vertical scroll during navigation between pages NEXT 13 App Dir
We can do a stack in a couple of ways, one concern with this approach might be what happens if user refreshes the browser while on the post page. What should be the user experience then.
5 replies
TTCTheo's Typesafe Cult
•Created by vitor markis 🎈 on 5/17/2023 in #questions
persist user vertical scroll during navigation between pages NEXT 13 App Dir
You can probably store last visible post in the feed in a context or global store and scroll to that when user goes back to feed page
5 replies
TTCTheo's Typesafe Cult
•Created by c1ub on 5/17/2023 in #questions
Is there a way in Zod to validate a field in a schema conditionally on another fields value?
You can use the the superRefine method it will give you more control https://github.com/colinhacks/zod#superrefine
4 replies
TTCTheo's Typesafe Cult
•Created by bento on 5/15/2023 in #questions
creating a type based on the input
const schema = someData.reduce(
(schema, definition) => schema.setKey(definition.name, z.string()),
z.object({})
);
4 replies
TTCTheo's Typesafe Cult
•Created by bento on 5/15/2023 in #questions
creating a type based on the input
You need to use the setKey method.
4 replies
TTCTheo's Typesafe Cult
•Created by gnarley_farley. on 5/14/2023 in #questions
Many queries when switching tabs
One downside to doing this at a global level can be users might get outdated or incorrect data if they come back after a while which can be days. I prefer to do it at a query level instead of doing it globally.
8 replies
TTCTheo's Typesafe Cult
•Created by zio_ on 5/10/2023 in #questions
What's the best way to store translation data for an app?
You can look at using i18next https://react.i18next.com/
3 replies
TTCTheo's Typesafe Cult
•Created by arete on 2/13/2023 in #questions
useState bug????
setState is async operation checking the value immediately after setting it will give previous value
2 replies