I have a Props type that looks as follows
type Props<FormData> = {
formData: FormData,
sectionNme: keyof FormData,
name: string
}
but what I'd like is something akin to
type Props<FormData> = {
formData: FormData,
sectionNme: keyof FormData,
name: keyof FormData[sectionName]
}
but I can't seem to access the sectionName field in this type definition. Is there a better way to type this, other than just string?