redux-saga-beginner-tutorial icon indicating copy to clipboard operation
redux-saga-beginner-tutorial copied to clipboard

error when with export default funcion in 1.1 beginnerTutorial

Open iLeonelPerea opened this issue 9 years ago • 1 comments
trafficstars

An issue because you export like default function and show the following error: check sagaMiddleware.run(saga, ...args): saga argument must be a Generator function!

export default function* rootSaga() { yield [ helloSaga(), watchIncrementAsync() ] }

you need change to:

export function* rootSaga() { yield [ helloSaga(), watchIncrementAsync() ] }

iLeonelPerea avatar Jun 15 '16 19:06 iLeonelPerea

Actually I believe it was meant to have the default assigned to it they can switch the import from using something similar to:

import { rootSaga } from './sagas'

to use the default:

import rootSaga from './sagas'

artarmstrong avatar Sep 14 '16 14:09 artarmstrong