chore: add warning for breaking changes

This commit is contained in:
Benjy Cui 2016-09-14 11:42:06 +08:00
parent 37e8474714
commit c754a3d3d4
3 changed files with 16 additions and 1 deletions

View File

@ -56,7 +56,7 @@ export default class Breadcrumb extends React.Component<BreadcrumbProps, any> {
warning(
!('linkRender' in props || 'nameRender' in props),
'`linkRender` and `nameRender` is removed, please use `itemRender` instead.'
'`linkRender` and `nameRender` are removed, please use `itemRender` instead.'
);
}

View File

@ -1,6 +1,7 @@
import * as React from 'react';
import RcMenu, { Item, Divider, SubMenu, ItemGroup } from 'rc-menu';
import animation from '../_util/openAnimation';
import warning from 'warning';
function noop() {
}
@ -68,6 +69,12 @@ export default class Menu extends React.Component<MenuProps, any> {
switchModeFromInline: boolean;
constructor(props) {
super(props);
warning(
!('onOpen' in props || 'onClose' in props),
'`onOpen` and `onClose` are removed, please use `onOpenChange` instead.'
);
this.state = {
openKeys: [],
};

View File

@ -10,6 +10,7 @@ import classNames from 'classnames';
import { flatArray, treeMap } from './util';
import assign from 'object-assign';
import splitObject from '../_util/splitObject';
import warning from 'warning';
function noop() {
}
@ -134,6 +135,13 @@ export default class Table extends React.Component<TableProps, any> {
constructor(props) {
super(props);
warning(
!('columnsPageRange' in props || 'columnsPageSize' in props),
'`columnsPageRange` and `columnsPageSize` are removed, please use ' +
'[fixed columns](http://ant.design/components/table/#components-table-demo-fixed-columns) ' +
'instead.'
);
const pagination = props.pagination || {};
this.state = assign({}, this.getSortStateFromColumns(), {