message: optimization to call the catalog only once per pu
diff: @@ -22,7 +22,7 @@ import {
  isUserEntity,
  isGroupEntity,
  } from '@backstage/catalog-model';
  -import React, { forwardRef } from 'react';
  +import React, { forwardRef, useState } from 'react';
  import { entityRouteRef } from '../../routes';
  import { humanizeEntityRef } from './humanize';
  import { Link, LinkProps, Progress } from '@backstage/core-components';
  @@ -81,12 +81,10 @@ export const PeekAheadPopover = ({
  const entityRoute = useRouteRef(entityRouteRef);
  const classes = useStyles();
  const apiHolder = useApiHolder();
  + const [entity, setEntity] = useState<Entity | undefined>();
  - const {
  - value: entity,
  - loading,
  - error,
  - } = useAsync(async () => {
  + const { loading, error } = useAsync(async () => {
  + if (!entity) {
  if (popupState.isOpen) {
  const catalogApi = apiHolder.get(catalogApiRef);
  if (catalogApi) {
  @@ -94,10 +92,10 @@ export const PeekAheadPopover = ({
  if (!retrievedEntity) {
  throw new Error(`${entityRef.name} was not found`);
  }
  - return retrievedEntity;
  + setEntity(retrievedEntity);
  + }
  }
  }
  - return undefined;
  }, [popupState.isOpen, apiHolder, entityRef]);
  return (
  