React.Dispatch<React.SetStateAction<string>>
상위 컴포넌트에서 useState 상태 변경 함수를 넘길 때 () => void 로 넘겼었는데 정의 할 수 있는 타입이 있었다 !
interface Props{
setIsMade: () => void
}
import React, {useState, Dispatch, SetStateAction} from 'react';
interface Props{
setIsMade: Dispatch<SetStateAction<boolean>>
}
set 함수를 넘길 때는 default 값에 따라
1)string 인 경우 React.Dispatch<React.SetStateAction<string>>
2)boolean 인 경우
React.Dispatch<React.SetStateAction<boolean>>