maxtreme
maxtreme
TTCTheo's Typesafe Cult
Created by maxtreme on 3/24/2023 in #questions
Rendering function vs variable assignment
Yeah, thought so. Thanks!!
10 replies
TTCTheo's Typesafe Cult
Created by maxtreme on 3/24/2023 in #questions
Rendering function vs variable assignment
It does somehow
10 replies
TTCTheo's Typesafe Cult
Created by sheng2808 on 2/13/2023 in #questions
react-hooks/exhaustive-deps issue
i prefer useDebounce from react-use but both will achieve the same
16 replies
TTCTheo's Typesafe Cult
Created by sheng2808 on 2/13/2023 in #questions
react-hooks/exhaustive-deps issue
yeah, should be fine
16 replies
TTCTheo's Typesafe Cult
Created by sheng2808 on 2/13/2023 in #questions
react-hooks/exhaustive-deps issue
It might be a better idea to do this length check in handleNameQuery and fetch from there
16 replies
TTCTheo's Typesafe Cult
Created by sheng2808 on 2/13/2023 in #questions
react-hooks/exhaustive-deps issue
In general you should be avoiding useEffect all together
16 replies
TTCTheo's Typesafe Cult
Created by sheng2808 on 2/13/2023 in #questions
react-hooks/exhaustive-deps issue
Yes, but you can just include it in the array - it's guaranteed to never change so it won't cause it to rerun
16 replies
TTCTheo's Typesafe Cult
Created by sheng2808 on 2/13/2023 in #questions
react-hooks/exhaustive-deps issue
Why are You using memo here? It's for values. I guess you're looking for useEffect
16 replies
TTCTheo's Typesafe Cult
Created by jack on 2/11/2023 in #questions
trpc/react-query render logic
Of course but swapping between views probably causes both a rerender and a refetch (it will happen even if there's cached value)
12 replies
TTCTheo's Typesafe Cult
Created by maxtreme on 2/12/2023 in #questions
Managing assets
Thanks for the answer. Moving everything to /public it is I guess. Dynamic import is interesting, will definitely look into that, thx
5 replies
TTCTheo's Typesafe Cult
Created by jack on 2/11/2023 in #questions
trpc/react-query render logic
Optimistic UI should do the thing but if it doesn't it seems like the toggle makes your components unmount. On the toggle they have to rerender so they also fetch (if I understand this correctly). If that's the case then maybe you will also have to keep your currently hidden component somewhere else in the DOM tree (could be done using portals) so it's ready whenever you need to swap between them
12 replies
TTCTheo's Typesafe Cult
Created by Donny D on 10/15/2022 in #questions
Please help with complex form query state management mess
That's one way to do it (and best in my opinion although I don't know how rest of this feature you're making looks like)
7 replies
TTCTheo's Typesafe Cult
Created by Donny D on 10/15/2022 in #questions
Please help with complex form query state management mess
You might want to use useFormContext with FormProvider and bring state upwards. Also if I understand correctly You're trying to set title and content from chapter that you load through query but those calls are neither in useEffect (with data in dependency array) or in onSuccess callback you may set in query's settings. Right now title and content will be set on every rerender
7 replies