useReducer returns an array containing the current state and the dispatch function for triggering actions.