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 to correctly handle JavaScript edge cases (NaN, +0/-0, null, undefined) when comparing objects. The focus is on proper usage of the package's shallowEqual functionality to detect property changes.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Uses shallowEqual",
"description": "Imports and uses the shallowEqual function from react-addons-shallow-compare or its underlying fbjs/lib/shallowEqual module",
"max_score": 30
},
{
"name": "NaN comparison",
"description": "Correctly handles NaN comparisons where NaN values are treated as equal (Object.is semantics), detecting no changes when both objects have NaN in the same property",
"max_score": 20
},
{
"name": "Zero distinction",
"description": "Correctly distinguishes between +0 and -0, detecting changes when one object has +0 and another has -0 in the same property",
"max_score": 20
},
{
"name": "Null handling",
"description": "Properly handles null values without errors, correctly detecting no changes when both objects have null in the same property",
"max_score": 15
},
{
"name": "Undefined handling",
"description": "Properly handles undefined values without errors, correctly detecting no changes when both objects have undefined in the same property",
"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