@nex-ui/react
Version:
🎉 A beautiful, modern, and reliable React component library.
14 lines (11 loc) • 368 B
JavaScript
import { mergeProps } from '@nex-ui/utils';
import { useNexUI } from '../provider/Context.mjs';
const useDefaultProps = ({ name, props })=>{
const { components } = useNexUI();
const defaultProps = components?.[name]?.defaultProps;
if (defaultProps) {
return mergeProps(defaultProps, props);
}
return props;
};
export { useDefaultProps };