From d566fe843d197f02f8a4fbcb9fb62349b95a8bb2 Mon Sep 17 00:00:00 2001 From: cybice Date: Tue, 13 Oct 2015 18:09:56 +0300 Subject: [PATCH] Fix React 0.13 support --- src/google_map.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/google_map.js b/src/google_map.js index ccaeb6e..2ceda7b 100644 --- a/src/google_map.js +++ b/src/google_map.js @@ -22,9 +22,18 @@ import raf from './utils/raf'; import assign from 'lodash/object/assign'; import isNumber from 'lodash/lang/isNumber'; -const ReactDOM = isReact14(React) - ? require('react-dom') - : React; +// To avoid Error with React 13, webpack will generate warning not error +// more details is here https://github.com/orgsync/react-list/pull/54 +let ReactDOM; +if (isReact14(React)) { + try { + ReactDOM = require('react-dom'); + } catch (e) { + ReactDOM = React; + } +} else { + ReactDOM = React; +} const kEPS = 0.00001;