This error could also mean that your are trying to dispatch a redux action that does not exist eg
const generalSlice = createSlice({
name: 'general',
initialState,
reducers: {
setDropdownSelectedDateRedux: (state, action) => {
state.dropdownSelectedDateRedux = action.payload;
},
},
extraReducers: (builder) => {
// get all data daily
builder.addCase(triggerGetAllDataDaily.pending, (state) => {
state.getAllDataDaily.status = states.LOADING;
state.getAllDataDaily.data = [];
});
builder.addCase(triggerGetAllDataDaily.fulfilled, (state: any,
action) => {
state.getAllDataDaily.status = states.SUCCESSFUL;
state.getAllDataDaily.data = action.payload;
});
builder.addCase(triggerGetAllDataDaily.rejected, (state) => {
state.getAllDataDaily.status = states.ERROR;
state.getAllDataDaily.data = [];
});
},
});
Note that the name of the reducer here is setDropdownSelectedDateRedux
But then when you try to dispatch a wrong reducer eg
const dispatch=useDispatch<any>()
useEffect(() => {
dispatch(
setDropdownSelectedDate({
title: dropdownSelectedDate.value,
value: dropdownOptionsDate.value,
})
);
}, []);
You will encounter this error