mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-21 13:18:04 +08:00
854cdb4352
* type: optimize CompoundedComponent type * chore: fix * type: fix type * chore: fix * type: fix type * type: add ts-ignore * fix: fix * chore: revert
23 lines
630 B
TypeScript
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;
|