Skip to content

Commit c5ba309

Browse files
authored
fix: defaultvalue 为空时,渲染异常 (#3015)
1 parent 2708514 commit c5ba309

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/packages/calendaritem/calendaritem.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ export const CalendarItem = React.forwardRef<
170170
? ([...(defaultValue as string[])] as string[])
171171
: (defaultValue as string[])
172172
}
173-
return undefined
173+
return type === 'single' ? '' : []
174174
}
175175

176176
const [currentDate, setCurrentDate] = usePropsValue<CalendarValue>({
@@ -451,7 +451,7 @@ export const CalendarItem = React.forwardRef<
451451
}
452452

453453
useEffect(() => {
454-
setCurrentDate(resetDefaultValue() || [])
454+
setCurrentDate(resetDefaultValue())
455455
}, [defaultValue])
456456

457457
useEffect(() => {

0 commit comments

Comments
 (0)