useState의 대체 함수
const[state, dispatch] = useReducer(reducer, initialState); dispatch({type: ‘type1’}); //dispatch는 reducer를 호출한다 function reducer(state, action){ //action은 {type: ‘type1’}을 받는다 }