PoM
PoM

Reputation: 161

Undefined is not a function in React Native project

I'm new to React Native. I'm trying to open existing React Native project in the emulator on Windows 10, but it throws this error:

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

I'm using 0.45.1 version of React Native. Why is this happening?

enter image description here

Upvotes: 2

Views: 941

Answers (1)

Andrew Li
Andrew Li

Reputation: 57954

combineReducers is a utility function exported by redux, not react-redux. It's not React-specific and it's a utility function so it's from the redux package. You're trying to import it from react-redux so it's undefined because it doesn't exist there, and when you try to execute the function it throws the error. Import it from redux:

import { combineReducers } from 'redux';

Upvotes: 1

Related Questions