mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-24 11:10:01 +08:00
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:
parent
f5831f121d
commit
17cd13fe53
@ -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 = [
|
||||
{
|
||||
|
@ -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 |
|
||||
|
@ -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 ====================
|
||||
|
@ -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 |
|
||||
|
Loading…
Reference in New Issue
Block a user