import React , { ComponentType } from 'react' ; export type WithClassDefaultProps = { className ? : string ; } ; const withClassDefault = < T extends { } > ( defaultClassName ) => ( BaseComponent ) : ComponentType < T & WithClassDefaultProps > => { return ( props ) => { const newProps = { className : defaultClassName , ... props , } ; return < BaseComponent { ... newProps } / > ; } ; } ; export default withClassDefault ;