Redux store się zmienia, ale aplikacja się nie rerenderuje

0

Dlaczego widok mojej aplikacji się nie przeładowuje ? W moim komponencie zdefiniowałem te funkcje

const mapDispatchToProps = dispatch => ({
    startRequest: () => dispatch(startUpdateRequest()),
    endRequest: () => dispatch(endUpdateRequest()),
    errorRequest: () => dispatch(errorUpdateRequest())
})

Odpowiadają im następujące akcje

export const startUpdateRequest = () => ({
    type: 'START_UPDATE_REQUEST'
})

export const endUpdateRequest = () => ({
    type: 'END_UPDATE_REQUEST'
})

export const errorUpdateRequest = () => ({
    type: 'ERROR_UPDATE_REQUEST'
})

Tak wygląda funkcja w której dispatchuje akcje

    const handleStatus = () => {
        startRequest()
        updateTodo({
            title,
            isFinished: !status
        })
        .then(endRequest())
        .catch(errorRequest())
    }

I w reducerze robie to

const todos = (state = initialState, action) => {
    switch(action.type) {
        case 'GET_TODOS':
            return { ...state, todos: action.todos }
        case 'START_UPDATE_REQUEST':
            return { ...state, updateRequest: { pending: true, error: null, success: null } }
        case 'END_UPDATE_REQUEST':
            return { ...state, updateRequest: { pending: false, error: null, success: true } }
        case 'ERROR_UPDATE_REQUEST':
            return { ...state, updateRequest: { pending: false, error: true, success: null } }
        default:
            return state
    }
}

dane w storze się zmieniają, ale moja aplikacja się nie przeładowuje, więc nie mogę zobaczyć zmian w widoku. Co robię źle ?

0

NVM udało się, błąd był gdzie indziej

1 użytkowników online, w tym zalogowanych: 0, gości: 1