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:
CHaBou 2017-09-16 21:17:22 +02:00
parent 507fc28200
commit f8366d010d
No known key found for this signature in database
GPG key ID: EF8D073B729A0B33
15 changed files with 103 additions and 107 deletions

View file

@ -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