Код редуктора
function reducer(state, action) {
switch (action.type) {
case 'add':
return {selectedArr: initialState.selectedArr.push(action.payload)};
case 'all':
return {all: !initialState.all};
case 'remove':
return {
selectedArr: initialState.selectedArr.splice(
initialState.selectedArr.indexOf(action.payload),
1,
),
};
default:
throw new Error();
}
}
Действие рассылка
<TouchableRipple
onPress={() => dispatch({type: 'all'})}
rippleColor={Theme.colors.accent}
>
<Surface style={[styles.ptpListFilterSurface]}>
<Text>All</Text>
</Surface>
</TouchableRipple>
Может кто-нибудь помочь мне с тем, почему только эта отправка не работает? Другие рассылки работают отлично