title: Redux-Saga error in React Native
body: <p>I've created an application using React Native and want to fetch data from API using redux-saga. 
  <br>Everything works fine before I configured my redux and sagas.
  <br>Here are the I added and modified :
  <br><br>ReactRestoRedux.js</p>
  
  <p><div class="snippet" data-lang="js" data-hide="true" data-console="true" data-babel="false">
  <div class="snippet-code snippet-currently-hidden">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>import { createReducer, createActions } from 'reduxsauce'
  import Immutable from 'seamless-immutable'
  
  // Categories types
  const { Types, Creators } = createActions({
      categories: null,
      categoriesSucceed: ['payload'],
      categoriesFailed: null
  })
  
  export const ReactRestoTypes = Types
  export default Creators
  
  // Initial state
  export const INITIAL_STATE = Immutable({
      payload: null,
      errorMessage: null,
      fetchCategories: false
  })
  
  // Reducers
  export const categoriesRequest = (state) =&gt; 
      state.merge({ fetchCategories: true })
  
  export const categoriesRequestSucceed = (state, action) =&gt; {
      const { payload } = action
      return state.merge({ fetchCategories: false, errorMessage: null, payload})
  }
  
  export const categoriesRequestFailed = (state) =&gt;
      state.merge({ fetchCategories: false, errorMessage: true})
  
  export const reducer = createReducer(INITIAL_STATE, {
      [Types.CATEGORIES_REQUEST]: categoriesRequest,
      [Types.CATEGORIES_SUCCEED]: categoriesRequestSucceed,
      [Types.CATEGORIES_FAILED]: categoriesRequestFailed
  })</code></pre>
  </div>
  </div>
  </p>
  
  <p><br><br>index.js (redux)</p>
  
  <p><div class="snippet" data-lang="js" data-hide="true" data-console="true" data-babel="false">
  <div class="snippet-code snippet-currently-hidden">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>import { takeLatest, all } from 'redux-saga/effects'
  //import API from '../Services/Api'
  import FixtureAPI from '../Services/FixtureApi'
  import DebugConfig from '../Config/DebugConfig'
  import ZomatoAPI from '../Services/ZomatoAPI'
  
  /* ------------- Types ------------- */
  
  import { StartupTypes } from '../Redux/StartupRedux'
  import { GithubTypes } from '../Redux/GithubRedux'
  import { ReactRestoTypes } from '../Redux/ReactRestoRedux'
  
  /* ------------- Sagas ------------- */
  
  import { startup } from './StartupSagas'
  import { getUserAvatar } from './GithubSagas'
  import { getCategories } from './ReactRestoSagas'
  
  /* ------------- API ------------- */
  
  // The API we use is only used from Sagas, so we create it here and pass along
  // to the sagas which need it.
  const api = DebugConfig.useFixtures ? FixtureAPI : ZomatoAPI.create()
  
  /* ------------- Connect Types To Sagas ------------- */
  
  export default function * root () {
    yield all([
      // some sagas only receive an action
      takeLatest(StartupTypes.STARTUP, startup),
  
      // some sagas receive extra parameters in addition to an action
      takeLatest(GithubTypes.USER_REQUEST, getUserAvatar, api),
  
      takeLatest(ReactRestoTypes.CATEGORIES_REQUEST, getCategories)
    ])
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p><br><br>ReactRestoSagas.js </p>
  
  <p><div class="snippet" data-lang="js" data-hide="true" data-console="true" data-babel="false">
  <div class="snippet-code snippet-currently-hidden">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>import { call, put } from 'redux-saga/effects'
  import { path } from 'ramda'
  import ReacRestoActions from '../Redux/ReactRestoRedux'
  import ReactRestoAPI from '../Services/ZomatoAPI'
  
  const api = ReactRestoAPI.create()
  
  export function* getCategories(){
      const response = yield call(api.getCategories)
      if(response.ok){
          //ok, call action from redux
          yield put(ReacRestoActions.categoriesSucceed(payload))
      }else{
          yield put(ReacRestoActions.categoriesFailed())
      }
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p><br><br>index.js(saga)</p>
  
  <p><div class="snippet" data-lang="js" data-hide="true" data-console="true" data-babel="false">
  <div class="snippet-code snippet-currently-hidden">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>import { takeLatest, all } from 'redux-saga/effects'
  //import API from '../Services/Api'
  import FixtureAPI from '../Services/FixtureApi'
  import DebugConfig from '../Config/DebugConfig'
  import ZomatoAPI from '../Services/ZomatoAPI'
  
  /* ------------- Types ------------- */
  
  import { StartupTypes } from '../Redux/StartupRedux'
  import { GithubTypes } from '../Redux/GithubRedux'
  import { ReactRestoTypes } from '../Redux/ReactRestoRedux'
  
  /* ------------- Sagas ------------- */
  
  import { startup } from './StartupSagas'
  import { getUserAvatar } from './GithubSagas'
  import { getCategories } from './ReactRestoSagas'
  
  /* ------------- API ------------- */
  
  // The API we use is only used from Sagas, so we create it here and pass along
  // to the sagas which need it.
  const api = DebugConfig.useFixtures ? FixtureAPI : ZomatoAPI.create()
  
  /* ------------- Connect Types To Sagas ------------- */
  
  export default function * root () {
    yield all([
      // some sagas only receive an action
      takeLatest(StartupTypes.STARTUP, startup),
  
      // some sagas receive extra parameters in addition to an action
      takeLatest(GithubTypes.USER_REQUEST, getUserAvatar, api),
  
      takeLatest(ReactRestoTypes.CATEGORIES_REQUEST, getCategories)
    ])
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p><br><br>Then I got this error :
  <a href="https://i.stack.imgur.com/S60tC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/S60tC.png" alt="enter image description here"></a></p>
  
  <p><br>I hope I can get any help for this, been stuck here for hours</p>