Skip to content

Instantly share code, notes, and snippets.

View XiaocongDong's full-sized avatar
:copilot:
Building some real shit

董小聪 XiaocongDong

:copilot:
Building some real shit
View GitHub Profile
@XiaocongDong
XiaocongDong / ReactPureComponent.js
Created July 3, 2019 06:49
React PureComponent inherits Component
function ComponentDummy() {}
ComponentDummy.prototype = Component.prototype;
/**
* Convenience component with default shallow equality check for sCU.
*/
function PureComponent(props, context, updater) {
this.props = props;
this.context = context;
// If a component has string refs, we will assign a different object later.