/** * Merges the provided props with default props. * If a value in `props` is `undefined` or `null` * it will be replaced by the corresponding value from `defaultProps`. * * This ensures that props always have a fallback value from `defaultProps` * * @param defaultProps - The default values for the props, used as fallbacks. * @param props - The props passed to the component, which may have missing or falsy values. * * @returns A new object that combines the `defaultProps` and `props`, with `props` values * overriding `defaultProps` where they are provided (unless `undefined` or `null`). * * @example * const defaultProps = { showOptionalText: true, tooltipPos: 'top' }; * const props = { tooltipPos: 'bottom' }; * const mergedProps = mergePropsWithDefaults(defaultProps, props); * console.log(mergedProps); // Output: { showOptionalText: true, tooltipPos: 'bottom' } */ export default function mergePropsWithDefaults>(props: Record, defaultProps: T): T;