Using esbuild to build a project that includes recharts gives the following warning:
▲ [WARNING] Comparison using the "!==" operator here is always true [equals-new-object]
.wrangler/tmp/pages-LvycvA/functionsWorker-0.3826531471696346.mjs:42421:46:
42421 │ ...ibuteName && [attributeName] !== from || !attributeName && s...
╵ ~~~
Equality with a new object is always false in JavaScript because the equality operator tests object identity. You need to write code to compare the contents of the object instead. For example, use "Array.isArray(x) && x.length === 0" instead of "x === []" to test for an empty array.
I traced that code back to react-smooth's Animate component:
Using esbuild to build a project that includes
recharts
gives the following warning:I traced that code back to
react-smooth
'sAnimate
component:https://github.com/recharts/react-smooth/blob/3ad17a73f12171ebe10cb1ad48c3f234f696f94f/src/Animate.js#L100-L103
Based on the git history, it looks like the intended code is this:
I don't know enough about this library to determine whether this logic bug has any practical impact.