How can I hide a node flag using twig I want to hide the flag on a node if a boolean field is unchecked. 

My Code in node.html.twig

{% if node.field_registration_status.value == 0 %}

&lt;div class="registration-closed"&gt;

    {{ content|without('content.flag_class_registration') }}

  &lt;/div&gt;

{% endif %}

{% if node.field_registration_status.value == 1 %}

   &lt;div class="registration-open"&gt;

     {{ content }}

   &lt;/div&gt;

{% endif %}


My CSS classes print as expected when the field is checked or unchecked. However, the Flag is not being removed from the output.
The without() filter's argument should be just the name of the key itself, which in this case is flag_class_registration without the content.. Consider - the filter only receives the expression that comes before it, so it's already inside the content array.

   {{ content|without('flag_class_registration') }}