refactor: remove cascader displayRender warning (#35417)

* refactor: remove useless warning (#35291)

* refactor: remove useless test case

* docs: remove cascader tagRender
This commit is contained in:
lalalazero 2022-05-10 13:57:38 +08:00 committed by GitHub
parent f5831f121d
commit 17cd13fe53
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 0 additions and 19 deletions

View File

@ -517,17 +517,6 @@ describe('Cascader', () => {
errorSpy.mockRestore();
});
it('displayRender & multiple', () => {
const errorSpy = jest.spyOn(console, 'error').mockImplementation(() => {});
mount(<Cascader multiple displayRender={() => null} />);
expect(errorSpy).toHaveBeenCalledWith(
'Warning: [antd: Cascader] `displayRender` not work on `multiple`. Please use `tagRender` instead.',
);
errorSpy.mockRestore();
});
it('should support showCheckedStrategy child', () => {
const multipleOptions = [
{

View File

@ -49,7 +49,6 @@ Cascade selection box.
| status | Set validation status | 'error' \| 'warning' | - | 4.19.0 |
| style | The additional style | CSSProperties | - | |
| suffixIcon | The custom suffix icon | ReactNode | - | |
| tagRender | Customize tag render when `multiple` | (props) => ReactNode | - | 4.17.0 |
| value | The selected value | string\[] \| number\[] | - | |
| onChange | Callback when finishing cascader select | (value, selectedOptions) => void | - | |
| onDropdownVisibleChange | Callback when popup shown or hidden | (value) => void | - | 4.17.0 |

View File

@ -165,12 +165,6 @@ const Cascader = React.forwardRef((props: CascaderProps<any>, ref: React.Ref<Cas
'Cascader',
'`popupClassName` is deprecated. Please use `dropdownClassName` instead.',
);
devWarning(
!multiple || !props.displayRender,
'Cascader',
'`displayRender` not work on `multiple`. Please use `tagRender` instead.',
);
}
// =================== No Found ====================

View File

@ -50,7 +50,6 @@ cover: https://gw.alipayobjects.com/zos/alicdn/UdS8y8xyZ/Cascader.svg
| status | 设置校验状态 | 'error' \| 'warning' | - | 4.19.0 |
| style | 自定义样式 | CSSProperties | - | |
| suffixIcon | 自定义的选择框后缀图标 | ReactNode | - | |
| tagRender | 自定义 tag 内容,多选时生效 | (props) => ReactNode | - | 4.17.0 |
| value | 指定选中项 | string\[] \| number\[] | - | |
| onChange | 选择完成后的回调 | (value, selectedOptions) => void | - | |
| onDropdownVisibleChange | 显示/隐藏浮层的回调 | (value) => void | - | 4.17.0 |