usually when we use typescript to write a react component,
defines an interface to props
something like this:
export interface AffixProps {
/**
*
*/
offsetTop?: number;
offset?: number;
/** */
offsetBottom?: number;
style?: React.CSSProperties;
/** */
onChange?: (affixed?: boolean) => void;
/** Affix DOM */
target?: () => Window | HTMLElement | null;
prefixCls?: string;
}
has made type restrictions on interfaces through typescript, and so on.
at the same time, proptypes is provided in react to verify props.
so now that interface, exists, can the role of proptypes be ignored, or is
proptypes an enhancement of interface?
how to understand the relationship between the two.
hopes to solve the problem ~