I'm trying to get a taxonomy term name by term ID. According to another post, I should load the term first:
$term = \Drupal::entityTypeManager()->getStorage('taxonomy')->load($tid);
But then I get this error :
Notice: Undefined property: Drupal\Core\Entity\Plugin\DataType\EntityReference::$target
What am I doing wrong? How can I get the term name?