ant-design/components/breadcrumb/BreadcrumbSeparator.tsx
黑雨 51c615dd42
refactor: Breadcrumb separator use li instead span (#40887)
* fix: fix 'span' to 'li'

* fix: fix 'span' to 'li'

* fix: update snap

* fix: update span to li

* feat: update snap

* feat: update snap

* feat: update snap

* feat: breadCrumb support  items

* feat: update snap

* feat: update snap

* feat: update snap
2023-02-24 18:20:28 +08:00

23 lines
637 B
TypeScript

import * as React from 'react';
import { ConfigContext } from '../config-provider';
type CompoundedComponent = React.FC<{ children?: React.ReactNode }> & {
/** @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;