Does ajax used in views call preprocessing hooks? I have a view with a bunch of fields and I'm styling those fields in:

views-view-fields.html.twig


In my .theme file I'm also using a preprocess function to pass additional variables to the above template.

function theme_preprocess_views_view_fields(&amp;$vars) {
  $vars['my_var'] = 'hello';
}


So in the twig template, I'm able to do something like:

{% for field in fields -%}
  {{my_var}}
{%- endfor %}


This is working like a charm for the first loaded fields, but when I hit "Load More" or I use exposed filters to filter down the view, the other loaded elements will not have my_var.

Now, "kinting" my_var directly in the template file. I saw that my_var is NULL for all other elements loaded after with Ajax and this made me think that the problem is with
theme_preprocess_views_view_fields being called once, the first time the page is loaded and completely being ignored from the Ajax call.

Shouldn't this preprocess be called and handled by the Ajax call Drupal is doing on the view itself?

If not, is there a way to query Drupal to re-run this hook when other elements are loaded?

Thanks!
In template "views-view-fields.html.twig" there is a three variables returned : "view", "fields", "row" you can see this here 
.

So to add your custom variables you need to put it into these three variables like below

 function dt8_preprocess_views_view_field(&amp;$vars)
  {
    $vars['row']-&gt;my_var = 'Hey';
  }


and in our template "views-view-fields.html.twig" we print int like this

{{ row.my_var }}