Question · JavaScript and React course · Module 4: Context API and useReducer

Action Creator in useReducer

What is an 'action creator' in the context of useReducer?

Answer options

  • A function that returns an action object with the appropriate type and payload
  • A React hook for automatically creating actions in components
  • A dispatch method for directly calling the reducer
  • A special React component for handling user events

You can check the correct answer by solving this task in the CodeWorlds game.