How to render a @FormElement in Views area plugin I am doing a custom plugin area for displaying some data in a views footer (Drupal 8).

I do something about just like this : Create a custom area plugin

The only point is, instead of #markup in the return array of render() method, I would like to return some more complex stuff.
If I try to return a textfield if works:

return  [
  '#type' =&gt; 'textfield',
];


If I try another form API element (defined via a @FormElement): it does not render.

return  [
  '#type' =&gt; 'datetime',
];


Two questions:


Should it render ?
If not, I can render a block there using this (ViewsBlockArea) how to do the equivalent but with a FormElement instead ? (actually rendering a form API render array.)


EDIT: Here a the finality of what I want to render:

$element['form'] = [
  '#type' =&gt; 'commerce_coupon_redemption_form',
  '#order_id' =&gt; $order-&gt;id(),
  '#cardinality' =&gt; 1,
  '#element_ajax' =&gt; [
    [get_class($this), 'ajaxRefreshSummary'],
  ],
];


But you may see that more trivial render array like the datetime one given above does not work either.

Also notice that any element defined by a @FormElement annotation from within the namespace Drupal\Core\Render\Element is okay.
But @FormElement "from elsewhere" like datetime does not render.
You can create block Form first. And from View UI, add a view object to your header or footer. And from View object configuration choose the form block you created.