diff --git a/components/descriptions/Cell.tsx b/components/descriptions/Cell.tsx index 928f43aeaa..0fbdb66caa 100644 --- a/components/descriptions/Cell.tsx +++ b/components/descriptions/Cell.tsx @@ -60,7 +60,7 @@ const Cell: React.FC = ({ colSpan={span} >
- {label && ( + {(label || label === 0) && ( = ({ {label} )} - {content && ( + {(content || content === 0) && ( {content} diff --git a/components/descriptions/__tests__/__snapshots__/index.test.js.snap b/components/descriptions/__tests__/__snapshots__/index.test.js.snap index 52c052dbcd..5142da10b0 100644 --- a/components/descriptions/__tests__/__snapshots__/index.test.js.snap +++ b/components/descriptions/__tests__/__snapshots__/index.test.js.snap @@ -209,6 +209,46 @@ exports[`Descriptions column is number 1`] = `
`; +exports[`Descriptions number 0 should render correct 1`] = ` +
+
+ + + + + + +
+
+ + 0 + + + 0 + +
+
+
+
+`; + exports[`Descriptions should work with React Fragment 1`] = `
{ wrapper.setProps({ extra: undefined }); expect(wrapper.find('.ant-descriptions-extra').exists()).toBe(false); }); + + it('number 0 should render correct', () => { + const wrapper = mount( + + + {0} + + , + ); + expect(wrapper.render()).toMatchSnapshot(); + }); });