Hi, I just recently came across this chunk in formik source code, which is causing type inconsistencies in my app when trying to use component for FieldArray:
export interface SharedRenderProps<T> {
component?: string | React.ComponentType<T | void>;
render?: ((props: T) => React.ReactNode);
children?: ((props: T) => React.ReactNode);
}
Could you please explain why void type is used for component properties here?
Not sure exactly why off the top of my head.
+1 to question.
It is now literally impossible to use component property in FIeldArray with proper typings and without some unneded typing tricks.
@jaredpalmer it would be great if you could check whether this property's type definition is correct.
+1, seems like the void is a mistake
Yeah, void type makes no sense and forces to use type casting. Maybe it was meant to be undefined? Why would ever received props have void type?
@jaredpalmer do you need help fixing this?
Most helpful comment
+1 to question.
It is now literally impossible to use component property in FIeldArray with proper typings and without some unneded typing tricks.
@jaredpalmer it would be great if you could check whether this property's type definition is correct.