react typescript spread props code example
Example: typescript ..otherProps
interface CustomComponentProps {
prop1: string;
prop2:string;
}
const CustomComponent: React.FC<CustomCompoenetProps & Record<string,any>> = ({prop1,prop2, ...otherProps}) => {
retrun (
<>
<Component prop1={prop1} prop2={prop2} {...otherProps}/>
</>
);
}
export default CustomComponent