Proxy ReactDOM for plugins (#1878)

* Proxy ReactDOM for plugins

* Update Module._load comment
This commit is contained in:
Albin Ekblom 2017-05-27 21:37:41 +02:00 committed by Philippe Potvin
parent 0d63360011
commit af43bbbfed

View file

@ -1,8 +1,11 @@
import {remote} from 'electron';
import {connect as reduxConnect} from 'react-redux';
// we expose these two deps to component decorators
// patching Module._load
// so plugins can `require` them wihtout needing their own version
// https://github.com/zeit/hyper/issues/619
import React from 'react';
import ReactDOM from 'react-dom';
import Component from '../component';
import Notification from '../components/notification';
import notify from './notify';
@ -13,6 +16,8 @@ Module._load = function (path) {
switch (path) {
case 'react':
return React;
case 'react-dom':
return ReactDOM;
case 'hyper/component':
return Component;
case 'hyper/notify':