preferConstantDispatchMove this inline useReducer action object to a module-level constant.small-rules/prefer-constant-dispatchDisallow inline useReducer action objects that could be module-level constants.
preferConstantDispatchMove this inline useReducer action object to a module-level constant.This rule does not accept options.
function Component() { const [state, dispatch] = useReducer(reducer, initialState);
dispatch({ type: "OPEN" });
return state;}function Component(type) { const [state, dispatch] = useReducer(reducer, initialState);
dispatch({ type });
return state;}