K
K
Kim_Soal2020-02-27 20:40:13
JavaScript
Kim_Soal, 2020-02-27 20:40:13

GetState doesn't come in thunk, why is that?

there is a sledge

export function prevDay(){
    return (dispatch, getState) => {
        // getState === undefined
        return dispatch(_prev( getState().day));
    }
}


dispatch is passed to it, getState is not present,
why can this be so?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
G
Glorious Cat, 2019-07-09
@N7EIght

It seems to me that at this moment:

$('.lang-qz').click(function () {
    localStorage['lang'] = 'qz';
    window.location.reload();
});

You need to do it like this:
$('.lang-qz').click(function () {
    localStorage.setItem('lang', 'qz');
    window.location.reload();
});

And accordingly, when checking:
Documentation .

K
Kim_Soal, 2020-02-27
@Kim_Soal

i immediately called the function
onClick={props.prevDay()}
i'm an idiot
thanks everyone for helping (me)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question