mirror of
https://github.com/ant-design/ant-design.git
synced 2025-06-12 04:13:13 +08:00
fix: Timeline with only one child should work, close: #7214
This commit is contained in:
parent
ad6dbcb9c6
commit
bee3c43e7a
@ -24,7 +24,7 @@ export default class Timeline extends React.Component<TimelineProps, any> {
|
||||
}, className);
|
||||
const items = React.Children.map(children, (ele: React.ReactElement<any>, idx) =>
|
||||
React.cloneElement(ele, {
|
||||
last: idx === (children as { length: number }).length - 1,
|
||||
last: idx === (React.Children.count(children) - 1),
|
||||
}),
|
||||
);
|
||||
const pendingItem = (!!pending) ? (
|
||||
|
Loading…
Reference in New Issue
Block a user