mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-11 23:00:20 +08:00
fix: narrow down types of string literals in a few defaultProps declarations (#22686)
This commit is contained in:
parent
7cea7dddc6
commit
2cb516b5b7
@ -120,7 +120,7 @@ class Button extends React.Component<ButtonProps, ButtonState> {
|
|||||||
loading: false,
|
loading: false,
|
||||||
ghost: false,
|
ghost: false,
|
||||||
block: false,
|
block: false,
|
||||||
htmlType: 'button',
|
htmlType: 'button' as ButtonProps['htmlType'],
|
||||||
};
|
};
|
||||||
|
|
||||||
private delayTimeout: number;
|
private delayTimeout: number;
|
||||||
|
@ -40,7 +40,7 @@ export default class Collapse extends React.Component<CollapseProps, any> {
|
|||||||
|
|
||||||
static defaultProps = {
|
static defaultProps = {
|
||||||
bordered: true,
|
bordered: true,
|
||||||
expandIconPosition: 'left',
|
expandIconPosition: 'left' as CollapseProps['expandIconPosition'],
|
||||||
};
|
};
|
||||||
|
|
||||||
renderExpandIcon = (panelProps: PanelProps = {}, prefixCls: string) => {
|
renderExpandIcon = (panelProps: PanelProps = {}, prefixCls: string) => {
|
||||||
|
@ -43,14 +43,14 @@ export interface ProgressProps {
|
|||||||
|
|
||||||
export default class Progress extends React.Component<ProgressProps> {
|
export default class Progress extends React.Component<ProgressProps> {
|
||||||
static defaultProps = {
|
static defaultProps = {
|
||||||
type: 'line',
|
type: 'line' as ProgressProps['type'],
|
||||||
percent: 0,
|
percent: 0,
|
||||||
showInfo: true,
|
showInfo: true,
|
||||||
// null for different theme definition
|
// null for different theme definition
|
||||||
trailColor: null,
|
trailColor: null,
|
||||||
size: 'default',
|
size: 'default' as ProgressProps['size'],
|
||||||
gapDegree: undefined,
|
gapDegree: undefined,
|
||||||
strokeLinecap: 'round',
|
strokeLinecap: 'round' as ProgressProps['strokeLinecap'],
|
||||||
};
|
};
|
||||||
|
|
||||||
getPercentNumber() {
|
getPercentNumber() {
|
||||||
|
@ -12,7 +12,7 @@ import { ConfigConsumerProps, ConfigConsumer } from '../config-provider';
|
|||||||
export default class TabBar extends React.Component<TabsProps> {
|
export default class TabBar extends React.Component<TabsProps> {
|
||||||
static defaultProps = {
|
static defaultProps = {
|
||||||
animated: true,
|
animated: true,
|
||||||
type: 'line',
|
type: 'line' as TabsProps['type'],
|
||||||
};
|
};
|
||||||
|
|
||||||
renderTabBar = ({ direction }: ConfigConsumerProps) => {
|
renderTabBar = ({ direction }: ConfigConsumerProps) => {
|
||||||
|
@ -21,7 +21,7 @@ export default class Timeline extends React.Component<TimelineProps, any> {
|
|||||||
|
|
||||||
static defaultProps = {
|
static defaultProps = {
|
||||||
reverse: false,
|
reverse: false,
|
||||||
mode: '',
|
mode: '' as TimelineProps['mode'],
|
||||||
};
|
};
|
||||||
|
|
||||||
renderTimeline = ({ getPrefixCls, direction }: ConfigConsumerProps) => {
|
renderTimeline = ({ getPrefixCls, direction }: ConfigConsumerProps) => {
|
||||||
|
@ -39,7 +39,7 @@ function getTreeData({ treeData, children }: DirectoryTreeProps) {
|
|||||||
class DirectoryTree extends React.Component<DirectoryTreeProps, DirectoryTreeState> {
|
class DirectoryTree extends React.Component<DirectoryTreeProps, DirectoryTreeState> {
|
||||||
static defaultProps = {
|
static defaultProps = {
|
||||||
showIcon: true,
|
showIcon: true,
|
||||||
expandAction: 'click',
|
expandAction: 'click' as DirectoryTreeProps['expandAction'],
|
||||||
};
|
};
|
||||||
|
|
||||||
static getDerivedStateFromProps(nextProps: DirectoryTreeProps) {
|
static getDerivedStateFromProps(nextProps: DirectoryTreeProps) {
|
||||||
|
Loading…
Reference in New Issue
Block a user