I have my reducer
const userAuthSlice = createSlice({
name: "userAuth",
initialState: {
token: '',
},
reducers: {
setToken: (state, action) => state.token = action.payload.test,
},
});
And I have my dispatch command
<button
value={text.sign_in.submit}
onClick={() => dispatch(userAuthSlice.actions.setToken({test:"test"}))}
/>
As I press the button what I get is this error:

I have isolated everything to be sure that this is the problem and nothing else.
Why does this error pop up?