I have a view that is being rendered like this
$view = Views::getView('view_id');
$view->setDisplay('block_1');
$view->execute();
$render = $view->render();
$html = \Drupal::service('renderer')->render($render);
The $html variable is being returned in the build method of a Block
public function build() {
return array(
'#theme' => 'theme_template',
'#view' => $html,
);
}
Then being outputted in the twig file {{ view }}{{ view }}
The view is being rendered but the pagination does not use ajax instead it reloads the page with the query string ?page=1
I have found a similar question but this is for drupal 7: Use ajax not working in views block displayed programmatically
Thank you in advance!