1
0
mirror of https://github.com/bobwen-dev/react-templates synced 2025-04-12 00:56:39 +02:00

fix broken --react-import-path when path is different from "react"

This commit is contained in:
Antonino Porcino 2016-08-15 12:21:24 +02:00 committed by ido
parent 5ccbfec25a
commit 12998d1022

View File

@ -91,10 +91,11 @@ function reactImport(options) {
if (options.native) {
return reactNativeSupport[options.nativeTargetVersion].react.module;
}
if (_.includes(['0.14.0', '0.15.0', '15.0.0', '15.0.1'], options.targetVersion)) {
return 'react';
if (!options.reactImportPath) {
const isNewReact = _.includes(['0.14.0', '0.15.0', '15.0.0', '15.0.1'], options.targetVersion);
return isNewReact ? 'react' : 'react/addons';
}
return 'react/addons';
return options.reactImportPath;
}
/**