My Props type declaration currently looks like this:
type Props<FormData> = {
formData: FormData,
sectionNme: keyof FormData,
name: string
}
However, I am trying to modify it to look more like the following:
type Props<FormData> = {
formData: FormData,
sectionNme: keyof FormData,
name: keyof FormData[sectionName]
}
I'm struggling to access the sectionName
field within this type definition. Is there a more effective way to achieve this without resorting to using just string
?