Legacy React addon for performing shallow comparison of props and state to optimize component rendering performance
Overall
score
99%
Build a React class component that displays user information and optimizes rendering performance using shallow comparison techniques.
Create a UserCard class component that:
name (string), age (number), and isActive (boolean)React.Component (do not use React.PureComponent)shouldComponentUpdate lifecycle method to control when re-renders occurThe component should only re-render when prop values actually change, not when the parent re-renders with identical prop values.
@generates
/**
* UserCard component displays user information with optimized rendering.
*
* @class UserCard
* @extends {React.Component}
*/
class UserCard extends React.Component {
/**
* Renders the user card with name, age, and active status.
*
* @returns {React.Element} The rendered user card
*/
render() {
// Implementation
}
}
export default UserCard;Provides shallow comparison functionality for component optimization.
React library for building the component.
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