How to pass rendered form results to page Drupal 8.7.x

I have a custom form that currently replaces the form with the output of the form like so: 

CalculationForm.php

  public function submitForm(array &amp;$form, FormStateInterface $form_state) {

    ...

    // Result overview.
    $result = [
      '#theme' =&gt; 'THEME_calculation_overview',
      '#name' =&gt; !empty($values['company_name']) ? $values['company_name'] : $form_state-&gt;getValue('firstname') . ' ' . $form_state-&gt;getValue('surname'),
      '#product' =&gt; $product,
      '#address' =&gt; $address,
      '#results' =&gt; $result_clean,
      '#urls' =&gt; $product_urls,
    ];

    // Bundle (rendered) results.
    $results_overview .= render($result);

    // Show rendered results.
    $this-&gt;response-&gt;addCommand(new ReplaceCommand('#form-calculation-container', $results_overview));
}


Currently the form submission makes an ajaxcall that replaces the container which holds the form with the rendered output (Replacecommand). Because we can't track the form submission with GTM I'm switching over to a normal form submission which redirects to a page. 

My question is, how can I pass $results_overview to the redirect page and make it render as part of the content variable. 

Thanks in advance
in your submitForm function you need to set rebuilt to true (the default is false) on the FormStateInterface then add the result as a value to the form_state. And in the buildForm function you need to check for the presence of the results variable and accordingly you can add it to the form. Something like this:  

  public function buildForm(array $form, FormStateInterface $form_state) {

    ...

    $result = $form_state-&gt;getValue('result');
    if($result){
      $form['calculation'] = $result;
    }

    ...

    return $form;
  }


and  

public function submitForm(array &amp;$form, FormStateInterface $form_state) {

  ...

  // Result overview.
  $result = [
    '#theme' =&gt; 'THEME_calculation_overview',
    '#name' =&gt; !empty($values['company_name']) ? $values['company_name'] : $form_state-&gt;getValue('firstname') . ' ' . $form_state-&gt;getValue('surname'),
    '#product' =&gt; $product,
    '#address' =&gt; $address,
    '#results' =&gt; $result_clean,
    '#urls' =&gt; $product_urls,
  ];

  $form_state-&gt;setRebuild();
  $form_state-&gt;setValue('result', $result);

}