Fix a react warning in <EntityListComponent>
`entityRef` should only be passed conditionally if component is present, otherwise React logs a warning/error to console. Signed-off-by: Oliver Sand <oliver.sand@sda-se.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-catalog-import': patch
|
||||
---
|
||||
|
||||
Fix a react warning in `<EntityListComponent>`.
|
||||
@@ -146,11 +146,15 @@ export const EntityListComponent = ({
|
||||
<List component="div" disablePadding dense>
|
||||
{sortEntities(r.entities).map(entity => (
|
||||
<ListItem
|
||||
component={withLinks ? EntityRefLink : 'div'}
|
||||
entityRef={withLinks ? entity : undefined}
|
||||
button={withLinks as any}
|
||||
key={formatEntityRefTitle(entity)}
|
||||
className={classes.nested}
|
||||
{...(withLinks
|
||||
? {
|
||||
component: EntityRefLink,
|
||||
entityRef: entity,
|
||||
button: withLinks as any,
|
||||
}
|
||||
: {})}
|
||||
>
|
||||
<ListItemIcon>{getEntityIcon(entity)}</ListItemIcon>
|
||||
<ListItemText primary={formatEntityRefTitle(entity)} />
|
||||
|
||||
Reference in New Issue
Block a user