How to use React Hook useReducer?