Undefined不是React Native项目中的函数

时间:2017-07-05 00:22:45

标签: android react-native redux react-redux

我是React Native的新手。我试图在Windows 10上的模拟器中打开现有的React Native项目,但它会抛出此错误:

undefined is not a function (evaluating '(0, _reactRedux.combineReducers)')

我使用的是0.45.1版本的React Native。为什么会这样?

enter image description here

1 个答案:

答案 0 :(得分:1)

combineReducers是由redux 导出的实用程序函数,而不是react-redux。它不是特定于React的,它是一个实用函数,所以它来自redux包。您正尝试从react-redux导入它,因此它未定义,因为它不存在,并且当您尝试执行该函数时,它会抛出错误。从redux

导入
import { combineReducers } from 'redux';