From a3d5004c1342d65bcb3c6301bc932957ff51ceff Mon Sep 17 00:00:00 2001 From: Matthew Conlen Date: Mon, 15 Aug 2016 01:17:33 -0400 Subject: [PATCH] allow plugins to require('react') --- lib/utils/plugins.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/utils/plugins.js b/lib/utils/plugins.js index c38aecde..7755c1b0 100644 --- a/lib/utils/plugins.js +++ b/lib/utils/plugins.js @@ -6,6 +6,15 @@ import React from 'react'; import Notification from '../components/notification'; import notify from './notify'; +var Module = require('module'); +var originalLoad = Module._load; +Module._load = function (path) { + if (path === 'react') { + return React; + } + return originalLoad.apply(this, arguments); +}; + // remote interface to `../plugins` let plugins = remote.require('./plugins');