Getting bug “Identical expressions should not be used on both sides of a binary operator typescript:S1764” when analysing a function call.
Using both sides of “&&” as the same to first make sure the variable is defined (truthy), much like in conditional rendering.
customClass && customClass
This seems like an acceptable use and could be a false-positive for the rule.
I might be missing something but it seems it would evaluate to the same thing:
customClass is falsy, it will evaluate to
customClass is truthy, it will evaluate to
In all cases
c gets passed the value of
Is there any reason you are not calling
customClass directly, like
That is a great explanation, thank you. I learned something!
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.