本地无法导入反应
我是新的反应。 我正在使用react-native
,我想导入react-redux
。
但我不断收到:
“开发服务器响应500。
消息:{转换错误:... / node_modules / redux / lib / index.js:{babel} .... / node_modules / redux / lib / index.js:
使用删除的babel 5选项:... / node_modules / redux / .babelrc.stage - 检出相应的阶段x预设http://babeljs.io/docs/plugins/#presets“。
我的package.json看起来像
"dependencies": {
"react": "15.3.2",
"react-native": "0.36.0",
"react-native-pathjs-charts": "0.0.20",
"react-native-svg": "^4.3.1",
"react-redux": "^4.4.5",
"redux": "^2.0.0"
},
"devDependencies": {
"babel-core": "6.3.26",
"babel-preset-es2015": "6.5.0",
"babel-preset-react": "6.5.0",
"babel-preset-stage-0": "6.5.0",
"babel-preset-stage-1": "6.5.0",
"eslint": "2.3.0",
"eslint-config-standard": "5.1.0",
"eslint-plugin-promise": "1.1.0",
"eslint-plugin-react": "4.1.0",
"eslint-plugin-standard": "1.3.2"
}
我的.babelrc看起来像
{
"presets": ["react-native", "stage-0"]
}
我在下面的组件中导入
import React, { Component } from 'react'
import {
View, Text, StyleSheet, ScrollView,
TouchableHighlight
} from 'react-native'
import { connect } from 'react-redux/src/index';
任何想法如何导入react-redux
到我的组件? 谢谢!