ant-design/components/breadcrumb/BreadcrumbSeparator.tsx
lijianan 854cdb4352
type: optimize CompoundedComponent type (#48346)
* type: optimize CompoundedComponent type

* chore: fix

* type: fix type

* chore: fix

* type: fix type

* type: add ts-ignore

* fix: fix

* chore: revert
2024-04-09 16:49:47 +08:00

23 lines
630 B
TypeScript

import * as React from 'react';
import { ConfigContext } from '../config-provider';
type CompoundedComponent = React.FC<React.PropsWithChildren> & {
/** @internal */
__ANT_BREADCRUMB_SEPARATOR: boolean;
};
const BreadcrumbSeparator: CompoundedComponent = ({ children }) => {
const { getPrefixCls } = React.useContext(ConfigContext);
const prefixCls = getPrefixCls('breadcrumb');
return (
<li className={`${prefixCls}-separator`} aria-hidden="true">
{children === '' ? children : children || '/'}
</li>
);
};
BreadcrumbSeparator.__ANT_BREADCRUMB_SEPARATOR = true;
export default BreadcrumbSeparator;