Skip to content
Permalink
Browse files

Require React and ReactDOM if 'require' function is defined

Fixes #406
Fixes #405
Fixes #389
  • Loading branch information...
ipeychev committed Dec 23, 2015
1 parent 2a1fb32 commit 763a43247ac2a486422cea52c3730579afe47108
Showing with 8 additions and 0 deletions.
  1. +8 −0 src/ui/react/template/alloy-editor.template
@@ -29,6 +29,10 @@
React = AlloyEditor.React;
}

if (typeof React === 'undefined' && typeof require === 'function') {
React = require('react');
}

var ReactDOM = (function() {
return (0, eval)('this').ReactDOM;
}());
@@ -37,6 +41,10 @@
ReactDOM = AlloyEditor.ReactDOM;
}

if (typeof ReactDOM === 'undefined' && typeof require === 'function') {
ReactDOM = require('react-dom');
}

if (typeof window !== 'undefined') {
deployCKEditor();

0 comments on commit 763a432

Please sign in to comment.
You can’t perform that action at this time.