chore: add warning for invalid usage, close: #3475

pull/3483/head
Benjy Cui 8 years ago
parent be02817433
commit f52dcbfb37

@ -2,6 +2,7 @@ import React from 'react';
import Animate from 'rc-animate';
import ScrollNumber from './ScrollNumber';
import classNames from 'classnames';
import warning from 'warning';
import splitObject from '../_util/splitObject';
export interface BadgeProps {
@ -64,6 +65,10 @@ export default class Badge extends React.Component<BadgeProps, any> {
[`${prefixCls}-not-a-wrapper`]: !children,
});
warning(
!(children && status),
'`Badge[children]` and `Badge[status]` cannot be used at the same time.'
);
// <Badge status="success" />
if (!children && status) {
const statusCls = classNames({

@ -82,7 +82,7 @@
"babel-jest": "^13.2.2",
"babel-plugin-import": "^1.0.0",
"babel-plugin-transform-runtime": "~6.15.0",
"bisheng": "^0.12.0",
"bisheng": "^0.13.0",
"bisheng-plugin-antd": "~0.2.0",
"bisheng-plugin-description": "^0.1.1",
"bisheng-plugin-react": "^0.2.0",

Loading…
Cancel
Save