title: Expected 0 arguments, but got 1. with Redux toolkit
body: <p>I am currently trying to build a simple example of redux using redux/toolkit. I am not sure what I am doing wrong.</p>
  <p>This is my store.</p>
  <pre><code>import { configureStore } from &quot;@reduxjs/toolkit&quot;;
  import reducer from &quot;./workouts&quot;;
  
  export default function () {
    return configureStore({ reducer });
  }
  </code></pre>
  <p>Here is my workouts.ts file</p>
  <pre><code>import { createAction } from '@reduxjs/toolkit'
  
  export interface IWorkout {
    id: number
    restTime: number
    workoutTime: number
    exercises: number[]
    numReps: number
  }
  
  export interface IState {
    workouts: IWorkout[]
  }
  
  export interface IAction {
    type: string
    payload: IWorkout[] | any
  }
  
  export const workoutAdded = createAction('workoutAdded')
  export const workoutDeleted = createAction('workoutDeleted')
  
  const defaultState: IState = {
    workouts: [],
  }
  
  let lastId = 0
  
  const reducer = (state: IState = defaultState, action: IAction): IState =&gt; {
    switch (action.type) {
      case workoutAdded.type:
        return {
          ...state,
          workouts: [
            ...state.workouts,
            {
              id: ++lastId,
              restTime: action.payload.restTime,
              workoutTime: action.payload.workoutTime,
              exercises: action.payload.exercises,
              numReps: action.payload.numReps,
            },
          ],
        }
      case workoutDeleted.type:
        return {
          ...state,
          workouts: state.workouts.filter((workout) =&gt; workout.id !== action.payload.id),
        }
      default:
        return state
    }
  }
  
  export default reducer
  
  </code></pre>
  <p>And here is my index.ts file</p>
  <pre><code>import { render } from &quot;react-dom&quot;;
  import configureStore from &quot;./store/store&quot;;
  import { workoutAdded } from &quot;./store/workouts&quot;;
  import App from &quot;./App&quot;;
  
  const store = configureStore();
  
  const newWorkout = {
    restTime: 10,
    workoutTime: 30,
    exercises: [1, 2, 3],
    NumReps: 6
  };
  
  store.dispatch(workoutAdded(newWorkout));
  
  const rootElement = document.getElementById(&quot;root&quot;);
  render(&lt;App /&gt;, rootElement);
  
  </code></pre>
  <p>My error appears in index.ts file in this line:</p>
  <pre><code>store.dispatch(workoutAdded(newWorkout));
  </code></pre>
  <p>Not sure what I am missing. I reproduced the error in this <a href="https://codesandbox.io/s/hungry-hellman-qmkep?file=/src/index.tsx:0-411" rel="nofollow noreferrer">sandbox</a></p>
  <p>This is the error that I am getting in the console:
  <a href="https://i.stack.imgur.com/plIe9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/plIe9.png" alt="enter image description here" /></a></p>