Skip to content

Commit

Permalink
fix: add judage case
Browse files Browse the repository at this point in the history
  • Loading branch information
1587315093 committed Jul 21, 2023
1 parent 5446350 commit 44c9a2c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/components/collapse/collapse.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,10 @@ export const Collapse: FC<CollapseProps> = props => {
initValue.value = [props.activeKey]

Check warning on line 156 in src/components/collapse/collapse.tsx

View check run for this annotation

Codecov / codecov/patch

src/components/collapse/collapse.tsx#L156

Added line #L156 was not covered by tests
}

if (props.defaultActiveKey) {
initValue.defaultValue = [props.defaultActiveKey]
if (
![null, undefined].includes(props.defaultActiveKey as null | undefined)
) {
initValue.defaultValue = [props.defaultActiveKey as string]
}

return initValue
Expand Down

0 comments on commit 44c9a2c

Please sign in to comment.