The logic in the js for this.has[LogicalName]Class
is always true, as the class is always defined.
For example if you have the html:
<div class="someclass" data-controller="example" data-example-hidden-class="hidden">
And then the js magic property:
hasHiddenClass: boolean
The boolean this.hasHiddenClass
is always true
.
My question is - what is the case where this would ever be false? I cannot see it ever being false.
Here is the docs regarding this property: https://stimulus.hotwired.dev/reference/css-classes