Jotas
TTCTheo's Typesafe Cult
•Created by 4z on 10/24/2024 in #questions
React UseState interface and eslint - am I doing this right?
notice i disabled no-unused-vars and enabled @typescript-eslint no-unused-vars with a bunch of relevant rules to ignore underscore (if you want that)
7 replies
TTCTheo's Typesafe Cult
•Created by 4z on 10/24/2024 in #questions
React UseState interface and eslint - am I doing this right?
Maybe you could set up your rules like this:
7 replies
TTCTheo's Typesafe Cult
•Created by 4z on 10/24/2024 in #questions
React UseState interface and eslint - am I doing this right?
as if eslint-no-unused-vars is "thinking" that your type definition is literally a runtime function
7 replies
TTCTheo's Typesafe Cult
•Created by 4z on 10/24/2024 in #questions
React UseState interface and eslint - am I doing this right?
you need to use the typescript specific rule
7 replies
TTCTheo's Typesafe Cult
•Created by reddie on 11/2/2024 in #questions
Recommended VSCode Extensions
Prettier and eslint, eslint can help by warning some common mistakes like react exhaustive deps.
what is wrong with your dev servers, there shouldnt be the need of any extensions for that.
Tailwind CSS IntelliSense is nice if you use it.
Colorize for colors on code.
4 replies
TTCTheo's Typesafe Cult
•Created by deviana on 7/6/2024 in #questions
should we stop using useMemo and useCallback in react v19?
AFAIK, yes. If you notice anything weird or rerendering more than you need then you can manually fix the specific case
6 replies
TTCTheo's Typesafe Cult
•Created by Palascat on 7/7/2024 in #questions
do you query the localstore everytime to get the token before making api calls ?
5 replies
TTCTheo's Typesafe Cult
•Created by Palascat on 7/7/2024 in #questions
do you query the localstore everytime to get the token before making api calls ?
Localstorage is generally unsafe and a bad idea to store things like tokens, its best to use cookies, most specially httpOnly cookies (and server sessions)
5 replies
TTCTheo's Typesafe Cult
•Created by nawed on 7/9/2024 in #questions
remotion media not seekable
What are you trying to do? seek a remotion video?
4 replies
TTCTheo's Typesafe Cult
•Created by Jotas on 7/7/2024 in #questions
Whats the point of this ternary operator in the nextjs homepage of Create T3 App?
Thank you for the answer, i understand the Suspense stuff, however this is not my code, this is default code for the nextjs application in Create T3 App, and im confused on why it works that way considering hello will never be null/undefined
7 replies
TTCTheo's Typesafe Cult
•Created by Paulo Martins on 7/7/2024 in #questions
About Theo's take of not destructuring props
you can also separate testColor and the component props with something like
React.FC<{ testColor: string, inputProps: React.ComponentPropsWithoutRef<"input"> }>
then
<input {...props.inputProps} />
which might be the best practice for that case (you can see that pattern all arround ui packages like Material UI)10 replies
TTCTheo's Typesafe Cult
•Created by Paulo Martins on 7/7/2024 in #questions
About Theo's take of not destructuring props
And yeah, youre absolutely correct about why the error happens, casting should bypass this without having to resort to an any type.
10 replies
TTCTheo's Typesafe Cult
•Created by Paulo Martins on 7/7/2024 in #questions
About Theo's take of not destructuring props
oh i see, yeah in that case destructuring is superior imo and i do it all the time lol
however i believe you can just cast it if you really need to.
<input {...props as React.ComponentPropsWithoutRef<"input">} />
10 replies
TTCTheo's Typesafe Cult
•Created by Vap0r1ze on 7/5/2024 in #questions
Is there any React frameworks that fit my needs?
i dont recall if it works well with Suspense but ideally you would just separate every "fetch before render" logic inside your getServerSideProps, everything else would be client-side, and you would be able to just Suspend it to wait for the getServerSideProps fetch
7 replies
TTCTheo's Typesafe Cult
•Created by Vap0r1ze on 7/5/2024 in #questions
Is there any React frameworks that fit my needs?
Have you tried the old pages router? maybe serverside props and incremental static regeneration will fit better your needs
7 replies
TTCTheo's Typesafe Cult
•Created by Paulo Martins on 7/7/2024 in #questions
About Theo's take of not destructuring props
which throws a warning.What warning? if you need default values "without destructuring" you can just use code before return like
10 replies