Upgrade React to v16
* Introduce 2 base components: Component and PureComponent. Before, we have only PureComponent but it was impossible to add a shoulComponentUpdate method (used for Terms).
This commit is contained in:
parent
507fc28200
commit
f8366d010d
15 changed files with 103 additions and 107 deletions
|
|
@ -6,7 +6,7 @@ import {connect as reduxConnect} from 'react-redux';
|
|||
// https://github.com/zeit/hyper/issues/619
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import Component from '../component';
|
||||
import {PureComponent} from '../base-components';
|
||||
import Notification from '../components/notification';
|
||||
import notify from './notify';
|
||||
|
||||
|
|
@ -20,7 +20,7 @@ Module._load = function _load(path) {
|
|||
case 'react-dom':
|
||||
return ReactDOM;
|
||||
case 'hyper/component':
|
||||
return Component;
|
||||
return PureComponent;
|
||||
case 'hyper/notify':
|
||||
return notify;
|
||||
case 'hyper/Notification':
|
||||
|
|
@ -457,7 +457,7 @@ function getDecorated(parent, name) {
|
|||
let class__;
|
||||
|
||||
try {
|
||||
class__ = fn(class_, {React, Component, Notification, notify});
|
||||
class__ = fn(class_, {React, PureComponent, Notification, notify});
|
||||
class__.displayName = `${fn._pluginName}(${name})`;
|
||||
} catch (err) {
|
||||
//eslint-disable-next-line no-console
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue