Legacy React addon for performing shallow comparison of props and state to optimize component rendering performance
Overall
score
99%
{
"context": "This criteria evaluates how well the engineer uses react-addons-shallow-compare's Object.is()-based equality checking to implement a shallow props comparison function. The focus is on correctly utilizing the package's shallowEqual utility or understanding its underlying Object.is() semantics.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Package import",
"description": "Correctly imports react-addons-shallow-compare or accesses its shallowEqual utility function",
"max_score": 15
},
{
"name": "NaN handling",
"description": "Uses Object.is() or the package's shallowEqual function to correctly treat NaN as equal to NaN (returns true for NaN === NaN)",
"max_score": 25
},
{
"name": "Zero distinction",
"description": "Uses Object.is() or the package's shallowEqual function to correctly distinguish between +0 and -0 (returns false for +0 === -0)",
"max_score": 25
},
{
"name": "Shallow comparison",
"description": "Implements shallow comparison that compares only enumerable own properties using Object.keys() and hasOwnProperty, consistent with the package's approach",
"max_score": 20
},
{
"name": "Property count check",
"description": "Verifies both objects have the same number of properties before comparing values, following the package's optimization pattern",
"max_score": 15
}
]
}Install with Tessl CLI
npx tessl i tessl/npm-react-addons-shallow-comparedocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10