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'
39
39
import type { OptionChild , SeparatorChild , GroupChild } from '../props'
40
40
import { Renderable } from '@instructure/shared-types'
41
41
42
- type PageChildren = GroupChild | OptionChild | SeparatorChild
42
+ type PageChildren = GroupChild | OptionChild | SeparatorChild | null | false
43
43
44
44
type DrilldownPageOwnProps = {
45
45
id : string
Original file line number Diff line number Diff line change @@ -528,15 +528,17 @@ class Drilldown extends Component<DrilldownProps, DrilldownState> {
528
528
const childMap = new Map < string , boolean > ( )
529
529
530
530
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
+ )
538
539
539
- return ( containsDuplicate = true )
540
+ return ( containsDuplicate = true )
541
+ }
540
542
}
541
543
}
542
544
You can’t perform that action at this time.
0 commit comments