jairrard
jairrard
TTCTheo's Typesafe Cult
Created by jairrard on 3/27/2024 in #questions
Building an application with multiple logged in accounts and multiple workspaces per account
multiple users
4 replies
TTCTheo's Typesafe Cult
Created by jairrard on 1/24/2024 in #questions
refreshing access token manually in axios
The refresh (if expired) only happens when an API is being called.
5 replies
TTCTheo's Typesafe Cult
Created by jairrard on 1/24/2024 in #questions
Error boundaries
Agreed. But in the case where there is a type mismatch, is there any way to handle it in a bit more user-friendly way where they don't just see a white screen?
7 replies
TTCTheo's Typesafe Cult
Created by jairrard on 1/24/2024 in #questions
Error boundaries
Yes it comes from an API
7 replies
TTCTheo's Typesafe Cult
Created by jairrard on 11/14/2023 in #questions
Using Radix Select with objects
Ok thanks
4 replies
TTCTheo's Typesafe Cult
Created by jairrard on 11/14/2023 in #questions
Radix Popover inside Radix Dialog not working
For some reason I needed to added pointer-events-auto to make it work
4 replies
TTCTheo's Typesafe Cult
Created by jairrard on 7/5/2023 in #questions
Same side panel on different routes
I am not using Next unfortunately - using react router. I thought about that but wanted to have a shareable link for the task which when gone to, has the task opened in the side panel
10 replies
TTCTheo's Typesafe Cult
Created by jairrard on 4/22/2023 in #questions
how tight should types be?
Hmmmm
12 replies
TTCTheo's Typesafe Cult
Created by jairrard on 4/22/2023 in #questions
how tight should types be?
ok yeah I think this makes sense. It is an issue since _id could exist as different types in each option in the union and so it not possible to use it for type narrowing
12 replies
TTCTheo's Typesafe Cult
Created by jairrard on 4/22/2023 in #questions
how tight should types be?
Logically if _id does exist the type should be
{
_id: ObjectId;
name: string;
email: string;
}
{
_id: ObjectId;
name: string;
email: string;
}
12 replies
TTCTheo's Typesafe Cult
Created by jairrard on 4/22/2023 in #questions
how tight should types be?
Strange. Isn't the basis of narrowing meant to be that some of the other types don't have it?
12 replies
TTCTheo's Typesafe Cult
Created by jairrard on 4/22/2023 in #questions
how tight should types be?
feels like unnecessary backend bloat to need to add a new field
12 replies
TTCTheo's Typesafe Cult
Created by jairrard on 4/22/2023 in #questions
how tight should types be?
Why can't I use if (tasker._id) {} for the narrowing? Shouldn't that be enough?
12 replies
TTCTheo's Typesafe Cult
Created by arete on 4/4/2023 in #questions
shadcn ui and react hook form
I am trying something similar where I have my own component library and need to pass the {...register(name, rules)} from my Form component down to my custom reusable inputs. I am getting the error Warning: Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()? when I try to do the following -
<TextInput
{...register("email", { required: true, pattern: /^\S+@\S+$/i })}
label="Email"
placeholder="[email protected]"
/>
<TextInput
{...register("email", { required: true, pattern: /^\S+@\S+$/i })}
label="Email"
placeholder="[email protected]"
/>
The props for TextInput are
type Props = {
type?: React.HTMLInputTypeAttribute;
value?: string;
onChange?: React.ChangeEventHandler<HTMLInputElement>;
onBlur?: React.FocusEventHandler<HTMLInputElement>;
name: string;
id?: string;
label?: string;
placeholder?: string;
htmlFor?: string;
error?: boolean;
helperText?: string | false | undefined;
onKeyDown?: React.KeyboardEventHandler<HTMLDivElement> | undefined;
min?: number | string;
max?: number | string;
disabled?: boolean;
// rules?: RegisterOptions;
};
type Props = {
type?: React.HTMLInputTypeAttribute;
value?: string;
onChange?: React.ChangeEventHandler<HTMLInputElement>;
onBlur?: React.FocusEventHandler<HTMLInputElement>;
name: string;
id?: string;
label?: string;
placeholder?: string;
htmlFor?: string;
error?: boolean;
helperText?: string | false | undefined;
onKeyDown?: React.KeyboardEventHandler<HTMLDivElement> | undefined;
min?: number | string;
max?: number | string;
disabled?: boolean;
// rules?: RegisterOptions;
};
I'm sure there are some mistakes in the props which I'd be happy to get some feedback on. But would really appreciate some help with using react-hook-form with custom reusable components!
16 replies
TTCTheo's Typesafe Cult
Created by jairrard on 4/7/2023 in #questions
div inside a div - preventing complex onClick event propagation
As of now the menu opens fine but then when I click a menu item or outside of the table, it still goes to the route
6 replies
TTCTheo's Typesafe Cult
Created by jairrard on 4/7/2023 in #questions
div inside a div - preventing complex onClick event propagation
Basically I am trying to make a table row such that when i click the row it goes to a route but if I click on a button icon in the row, it opens a menu from which I can click some options
6 replies
TTCTheo's Typesafe Cult
Created by jairrard on 4/7/2023 in #questions
div inside a div - preventing complex onClick event propagation
where can I create a sandbox to give the example in detail?
6 replies
TTCTheo's Typesafe Cult
Created by Aman on 3/20/2023 in #questions
Drag and drop UI
5 replies
TTCTheo's Typesafe Cult
Created by Aman on 3/20/2023 in #questions
Drag and drop UI
Theo recommends dndkit
5 replies
TTCTheo's Typesafe Cult
Created by jairrard on 3/20/2023 in #questions
Moving to NextJS
Any idea about how react query fits into Next 13 + RSC?
14 replies