Sha256: 29e47a26e087f4014e817fa4261681d03af46a8c5291544c086c3b80923a61c7
Contents?: true
Size: 532 Bytes
Versions: 69
Compression:
Stored size: 532 Bytes
Contents
import { Component } from 'preact'; import { shallowDiffers } from './util'; /** * Component class with a predefined `shouldComponentUpdate` implementation */ export function PureComponent(p) { this.props = p; } PureComponent.prototype = new Component(); // Some third-party libraries check if this property is present PureComponent.prototype.isPureReactComponent = true; PureComponent.prototype.shouldComponentUpdate = function(props, state) { return shallowDiffers(this.props, props) || shallowDiffers(this.state, state); };
Version data entries
69 entries across 69 versions & 1 rubygems