In Redux Toolkit, both forms of dispatching send an action object to the store, but using actionCreator(payload) is preferred because it automatically generates the correct action type and structure, ensuring consistency and reducing errors.
dispatch(actionCreator(payload)) uses the auto-generated action creator from createSlice(), which ensures the correct type and formats the payload automatically.
dispatch({ type, payload }) manually defines the action object, which can lead to mistakes if the type string or structure is incorrect.
Using actionCreator() also provides better TypeScript support and avoids hardcoding action types.