diff --git a/src/Plugin/YamlFormElement/YamlFormEntityReferenceTrait.php b/src/Plugin/YamlFormElement/YamlFormEntityReferenceTrait.php
index 540e91a..b1dd04c 100644
--- a/src/Plugin/YamlFormElement/YamlFormEntityReferenceTrait.php
+++ b/src/Plugin/YamlFormElement/YamlFormEntityReferenceTrait.php
@@ -340,7 +340,7 @@ trait YamlFormEntityReferenceTrait {
     $build = [];
     foreach ($entity_ids as $entity_id) {
       $entity = (isset($entities[$entity_id])) ? $entities[$entity_id] : NULL;
-      $build[$entity_id] = ($entity) ? $this->entityTypeManager($entity, $view_mode) : ['#markup' => $entity_id];
+      $build[$entity_id] = ($entity) ? \Drupal::entityTypeManager()->getViewBuilder($entity->getEntityTypeId())->view($entity, $view_mode) : ['#markup' => $entity_id];
     }
 
     if ($this->isMultiline($element) || count($build) > 1) {
