Fix React 0.13 support

This commit is contained in:
cybice 2015-10-13 18:09:56 +03:00
parent d4d7f85844
commit d566fe843d

View File

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