Skip to content

Commit

Permalink
fix: 修复折叠面板不能放一个子元素的问题 (#116)
Browse files Browse the repository at this point in the history
* fix: 修复折叠面板不能放一个子元素的问题 (#116)
  • Loading branch information
wayne authored Dec 13, 2021
1 parent 8622dd3 commit 16cd175
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/vantui/src/collapse/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { cloneElement, useCallback, useMemo } from 'react'
import { cloneElement, useCallback, useMemo, Children } from 'react'
import { ITouchEvent, View } from '@tarojs/components'

import { CollapseProps } from '../../types/collapse'
Expand Down Expand Up @@ -43,7 +43,7 @@ export function Collapse(props: CollapseProps) {
)

const newChildren: any = useMemo(() => {
return children?.map((child: any, index: number) => {
return Children.map(children, (child: any, index: number) => {
return cloneElement(child, {
key: index,
parent: {
Expand Down

0 comments on commit 16cd175

Please sign in to comment.