import { useDefaultProps } from './useDefaultProps' ; export function createHook < P , RP = void > ( useHook , config ? ) { return ( props , { disableCSSProps = [ ] , themeKey : themeKeyOverride = undefined } = { } ) => { const themeKey = themeKeyOverride || props ?. themeKey || config ?. themeKey ; const { props : newProps } = useDefaultProps ( props , { ... config , themeKey } ) ; return useHook ( newProps , { disableCSSProps , themeKey : config ?. themeKey , } ) ; } ; }