I would like to get deep value from the object, for example result when generic is "books":
fieldName: {author: "", langauge: "", translation: ""}
export const COLLECTIONS_MOCKUP = {
books: {
author: "",
language: "",
translation: "",
},
vehicle: {
model: "",
type: "",
color: "",
},
}
export interface IOptionalField<T> {
fieldName: typeof COLLECTIONS_MOCKUP[T]; // how to make it work, it throws an error
valueType: string | number | boolean | Date;
isAdded?: boolean;
}