mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-25 03:29:59 +08:00
56c42e496b
* refactor(breadcrumb): rewrite with hook * Update BreadcrumbItem.tsx
18 lines
546 B
TypeScript
18 lines
546 B
TypeScript
import * as React from 'react';
|
|
import { ConfigContext } from '../config-provider';
|
|
|
|
interface BreadcrumbSeparatorInterface extends React.FC {
|
|
__ANT_BREADCRUMB_SEPARATOR: boolean;
|
|
}
|
|
|
|
const BreadcrumbSeparator: BreadcrumbSeparatorInterface = ({ children }) => {
|
|
const { getPrefixCls } = React.useContext(ConfigContext);
|
|
const prefixCls = getPrefixCls('breadcrumb');
|
|
|
|
return <span className={`${prefixCls}-separator`}>{children || '/'}</span>;
|
|
};
|
|
|
|
BreadcrumbSeparator.__ANT_BREADCRUMB_SEPARATOR = true;
|
|
|
|
export default BreadcrumbSeparator;
|