Mintberry Mintberry - 27 days ago 10
React JSX Question

Redux Saga select is not a function

I am trying to get my state from inside a saga using the

select
effect.

I used this answer to start - getState in redux-saga?

Code:

const { select } = ReduxSaga
select()


Using this codepen redux saga setup (line 35).

Error - select is not a function


Much appreciated.

Answer

The select is undefined.

You may need to upgrade your version of react-saga from 0.5.0 to a higher version.

e.g. From https://npmcdn.com/redux-saga@0.5.0/dist/redux-saga.min.js to https://npmcdn.com/redux-saga@0.9.0/dist/redux-saga.min.js

(At least 0.9.0 is ok in my test. 0.12.1 is the latest.)

And import it from ReduxSaga.effects

const { put, call, select } = ReduxSaga.effects;

The revised will be:

enter image description here