Skip to content

Commit bad08ef

Browse files
committed
refactor(CCollapse): improve syntax
1 parent f36a5a0 commit bad08ef

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/components/collapse/CCollapse.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,15 @@ export const CCollapse = forwardRef<HTMLDivElement, CCollapseProps>(
3333
}
3434

3535
const onEntering = () => {
36-
collapseRef && collapseRef.current && setHeight(collapseRef.current.scrollHeight)
36+
collapseRef.current && setHeight(collapseRef.current.scrollHeight)
3737
}
3838

3939
const onEntered = () => {
4040
setHeight(0)
4141
}
4242

4343
const onExit = () => {
44-
collapseRef && collapseRef.current && setHeight(collapseRef.current.scrollHeight)
44+
collapseRef.current && setHeight(collapseRef.current.scrollHeight)
4545
}
4646

4747
const onExiting = () => {

0 commit comments

Comments
 (0)