mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-11-30 11:08:45 +08:00
fix: Spin render 0 (#27839)
This commit is contained in:
parent
30372ffad3
commit
c04e51048d
@ -42,4 +42,11 @@ describe('Spin', () => {
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
Spin.setDefaultIndicator(null);
|
||||
});
|
||||
|
||||
it('should render 0', () => {
|
||||
const wrapper = mount(
|
||||
<Spin>{0}</Spin>,
|
||||
);
|
||||
expect(wrapper.find('.ant-spin-container').at(0).text()).toBe('0');
|
||||
});
|
||||
});
|
||||
|
@ -127,7 +127,7 @@ class Spin extends React.Component<SpinProps, SpinState> {
|
||||
}
|
||||
|
||||
isNestedPattern() {
|
||||
return !!(this.props && this.props.children);
|
||||
return !!(this.props && typeof this.props.children !== 'undefined');
|
||||
}
|
||||
|
||||
renderSpin = ({ getPrefixCls, direction }: ConfigConsumerProps) => {
|
||||
|
Loading…
Reference in New Issue
Block a user