There is no replacement hook. In fact, many things that were hooks should now be done with webform handlers.
Below is a simplified version of my solution. Note that in order to set the options dynamically, the field must be added already with dummy option(s), or you need to add the field in the handler prior to setting its options.
<?php
namespace Drupal\my_module\Plugin\WebformHandler;
use Drupal\Core\Form\FormStateInterface;
use Drupal\webform\Plugin\WebformHandlerBase;
use Drupal\webform\WebformSubmissionInterface;
/**
* My Module custom webform handler.
*
* @WebformHandler(
* id = "my_module_custom_webform_handler",
* label = @Translation("My Webform Handler"),
* category = @Translation("Custom"),
* description = @Translation("Alter form to populate field."),
* cardinality = \Drupal\webform\Plugin\WebformHandlerInterface::CARDINALITY_SINGLE,
* results = \Drupal\webform\Plugin\WebformHandlerInterface::RESULTS_PROCESSED,
* submission = \Drupal\webform\Plugin\WebformHandlerInterface::SUBMISSION_OPTIONAL,
* )
*/
class MyModuleCustomWebformHandler extends WebformHandlerBase {
/**
* {@inheritdoc}
*/
public function alterForm(array &$form, FormStateInterface $form_state, WebformSubmissionInterface $webform_submission): void {
// Clear dummy options and set program options.
$form['elements']['my_radios']['#options'] = $this->customService->getOptionList();
}
}
Though the article below is not exactly what I needed, this was the step in the right direction that helped me find this solution: