CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-react-addons-shallow-compare

Legacy React addon for performing shallow comparison of props and state to optimize component rendering performance

Overall
score

99%

Overview
Eval results
Files

rubric.jsonevals/scenario-4/

{
  "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-compare

tile.json