File tree Expand file tree Collapse file tree 2 files changed +11
-9
lines changed
packages/ui-drilldown/src/Drilldown Expand file tree Collapse file tree 2 files changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ import DrilldownSeparator from '../DrilldownSeparator'
3939import type { OptionChild , SeparatorChild , GroupChild } from '../props'
4040import { Renderable } from '@instructure/shared-types'
4141
42- type PageChildren = GroupChild | OptionChild | SeparatorChild
42+ type PageChildren = GroupChild | OptionChild | SeparatorChild | null | false
4343
4444type DrilldownPageOwnProps = {
4545 id : string
Original file line number Diff line number Diff line change @@ -528,15 +528,17 @@ class Drilldown extends Component<DrilldownProps, DrilldownState> {
528528 const childMap = new Map < string , boolean > ( )
529529
530530 for ( const child of children ) {
531- if ( ! childMap . has ( child . props . id ) ) {
532- childMap . set ( child . props . id , true )
533- } else {
534- warn (
535- false ,
536- `Duplicate id: "${ child . props . id } "! Make sure all options have unique ids, otherwise they won't be rendered.`
537- )
531+ if ( child && typeof child === 'object' && child . props ?. id ) {
532+ if ( ! childMap . has ( child . props . id ) ) {
533+ childMap . set ( child . props . id , true )
534+ } else {
535+ warn (
536+ false ,
537+ `Duplicate id: "${ child . props . id } "! Make sure all options have unique ids, otherwise they won't be rendered.`
538+ )
538539
539- return ( containsDuplicate = true )
540+ return ( containsDuplicate = true )
541+ }
540542 }
541543 }
542544
You can’t perform that action at this time.
0 commit comments