@mui/base
Version:
A library of headless ('unstyled') React UI components and low-level hooks.
10 lines • 323 B
JavaScript
/**
* If `componentProps` is a function, calls it with the provided `ownerState`.
* Otherwise, just returns `componentProps`.
*/
export default function resolveComponentProps(componentProps, ownerState) {
if (typeof componentProps === 'function') {
return componentProps(ownerState);
}
return componentProps;
}