Sha256: f995f39b661db4167ac55af5d54e7b42377fe77b0d13535c6a114639c6bc1047
Contents?: true
Size: 547 Bytes
Versions: 12
Compression:
Stored size: 547 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
12 entries across 12 versions & 1 rubygems