diff --git a/components/badge/ScrollNumber.tsx b/components/badge/ScrollNumber.tsx index af3614070d..2f973afe46 100644 --- a/components/badge/ScrollNumber.tsx +++ b/components/badge/ScrollNumber.tsx @@ -3,7 +3,7 @@ import { createElement, Component } from 'react'; import omit from 'omit.js'; import classNames from 'classnames'; -function getNumberArray(num: string | number | undefined) { +function getNumberArray(num: string | number | undefined | null) { return num ? num.toString() .split('') @@ -14,16 +14,16 @@ function getNumberArray(num: string | number | undefined) { export interface ScrollNumberProps { prefixCls?: string; className?: string; - count?: string | number; + count?: string | number | null; component?: string; onAnimated?: Function; style?: React.CSSProperties; - title?: string | number; + title?: string | number | null; } export interface ScrollNumberState { animateStarted?: boolean; - count?: string | number; + count?: string | number | null; } export default class ScrollNumber extends Component { diff --git a/components/badge/index.tsx b/components/badge/index.tsx index a09788d5a8..294b1646cc 100644 --- a/components/badge/index.tsx +++ b/components/badge/index.tsx @@ -8,7 +8,7 @@ export { ScrollNumberProps } from './ScrollNumber'; export interface BadgeProps { /** Number to show in badge */ - count?: number | string; + count?: number | string | null; showZero?: boolean; /** Max count to show */ overflowCount?: number;