import * as React from 'react'; import splitObject from '../_util/splitObject'; interface BreadcrumbItemProps { separator?: React.ReactNode; href?: string; } export default class BreadcrumbItem extends React.Component { static defaultProps = { prefixCls: 'ant-breadcrumb', separator: '/', }; static propTypes = { prefixCls: React.PropTypes.string, separator: React.PropTypes.oneOfType([ React.PropTypes.string, React.PropTypes.element, ]), href: React.PropTypes.string, }; render() { const [{ prefixCls, separator, children }, restProps] = splitObject( this.props, ['prefixCls', 'separator', 'children'] ); let link; if ('href' in this.props) { link = {children}; } else { link = {children}; } return ( {link} {separator} ); } }