Skip to content

Commit

Permalink
fix: Accordion can't handle null value as child #703 (#731)
Browse files Browse the repository at this point in the history
  • Loading branch information
pomfrida authored and vnys committed Nov 13, 2020
1 parent a0d8495 commit 9cb7a2c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions libraries/core-react/src/Accordion/Accordion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const Accordion = forwardRef<
const accordionId = useMemo<string>(() => createId('accordion-'), [])

const AccordionItems = React.Children.map(children, (child, index) => {
if (!child) return null
return React.cloneElement(child as ReactElement, {
accordionId,
index,
Expand Down

0 comments on commit 9cb7a2c

Please sign in to comment.