Limit the props that are forwarded to the Link component in the EntityRefLink

This commit is contained in:
Dominik Henneke
2021-02-11 11:47:13 +01:00
parent 14f04073ef
commit d34d26125b
2 changed files with 7 additions and 2 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-catalog-react': patch
---
Limit the props that are forwarded to the `Link` component in the `EntityRefLink`.
@@ -32,7 +32,7 @@ type EntityRefLinkProps = {
export const EntityRefLink = React.forwardRef<any, EntityRefLinkProps>(
(props, ref) => {
const { entityRef, defaultKind, children } = props;
const { entityRef, defaultKind, children, ...linkProps } = props;
let kind;
let namespace;
@@ -61,7 +61,7 @@ export const EntityRefLink = React.forwardRef<any, EntityRefLinkProps>(
<Link
ref={ref}
to={generatePath(`/catalog/${entityRoute.path}`, routeParams)}
{...props}
{...linkProps}
>
{children}
{!children && formatEntityRefTitle(entityRef, { defaultKind })}