brmzkw
brmzkw
TTCTheo's Typesafe Cult
Created by KP on 1/5/2023 in #questions
Typescript doesn't show which prop should be provided
3 replies
TTCTheo's Typesafe Cult
Created by brmzkw on 12/16/2022 in #questions
How to infer the ref type of a component?
wooouhh, actually I can
const LabelInput = React.forwardRef(({ text, ...props }: LabelInputProps, ref: React.ComponentPropsWithRef<typeof Input>["ref"]) => {
const LabelInput = React.forwardRef(({ text, ...props }: LabelInputProps, ref: React.ComponentPropsWithRef<typeof Input>["ref"]) => {
it seems to work to put the type here.
3 replies
TTCTheo's Typesafe Cult
Created by brmzkw on 12/16/2022 in #questions
How to infer the ref type of a component?
I tried React.ComponentPropsWithRef<typeof Input>["ref"] but it doesn't work, I'm not sure it even makes sense.
3 replies