I am having problem understanding the below code from redux-form
export type DataSelector<FormData = {}, State = {}> = (formName: string, getFormState?: GetFormState) => (state: State) => FormData;
export const getFormValues: DataSelector;
// mapState
const values = getFormValues("formName")(state) // {}
return { form: values }
The IDE is giving me error that values is returning {}. Which is expected because State = {}. However, I want to use the access the values.name. Is there a way to pass in FormData or State?
FormData = {}means it will be an empty object. You can update your type toFormData = { name: string }- Rajesh