native unable to import react

I am new to reactjs. I am using react-native and I wanted to import react-redux .
But I keep getting:

"development server response 500.
Message: {transform error: .../node_modules/redux/lib/index.js: {babel}..../node_modules/redux/lib/index.js:
Using removed babel 5 option: .../node_modules/redux/.babelrc.stage - check out the corresponding stage x presets http://babeljs.io/docs/plugins/#presets".

My package.json looks like

"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"
  }

My .babelrc looks like

{
  "presets": ["react-native", "stage-0"]
}

I am importing in my component like below

import React, { Component } from 'react'
import {
    View, Text, StyleSheet, ScrollView,
    TouchableHighlight
} from 'react-native'


import { connect } from 'react-redux/src/index';

Any idea how to import react-redux into my component? Thank you!

链接地址: http://www.djcxy.com/p/32976.html

上一篇: 带有反应jsx和babel的意外标记

下一篇: 本地无法导入反应