Closed no23reason closed 7 years ago
This rule is reporting false positives in situations where the lambda is used as a parameter to a function returning some value. For example:
interface Item { value: number; } <Currency amount={ _.sumBy(items, (item: Item) => item.value) } />
This usage does not have any negative implications with regards to the shallowCompare render optimisation as the lambda is never actually compared.
shallowCompare
I am aware that simple workaround would often be to compute the value into a variable and then use it like this:
interface Item { value: number; } const total = _.sumBy(items, (item: Item) => item.value); <Currency amount={ total } />
However, that seems tedious and unnecessary.
👍 Seems like a reasonable enhancement @no23reason
This rule is reporting false positives in situations where the lambda is used as a parameter to a function returning some value. For example:
This usage does not have any negative implications with regards to the
shallowCompare
render optimisation as the lambda is never actually compared.I am aware that simple workaround would often be to compute the value into a variable and then use it like this:
However, that seems tedious and unnecessary.