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-6/

{
  "context": "This criteria evaluates how well the engineer uses react-addons-shallow-compare to implement a React component that properly distinguishes between positive and negative zero values. The focus is on correct usage of the shallowCompare function within shouldComponentUpdate to enable the component to detect sign changes in zero values.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "Import shallowCompare",
      "description": "The solution correctly imports the shallowCompare function from react-addons-shallow-compare package",
      "max_score": 15
    },
    {
      "name": "shouldComponentUpdate implementation",
      "description": "The component implements the shouldComponentUpdate lifecycle method to control rendering behavior",
      "max_score": 20
    },
    {
      "name": "shallowCompare usage",
      "description": "The shouldComponentUpdate method calls shallowCompare with the correct three arguments: (this, nextProps, nextState)",
      "max_score": 25
    },
    {
      "name": "Return value handling",
      "description": "The shouldComponentUpdate method returns the boolean value returned by shallowCompare without modification",
      "max_score": 20
    },
    {
      "name": "Zero sign detection",
      "description": "The component correctly distinguishes between +0 and -0 in the render output by using Object.is or 1/value to determine the sign",
      "max_score": 20
    }
  ]
}

Install with Tessl CLI

npx tessl i tessl/npm-react-addons-shallow-compare

tile.json