타입을 마치 함수의 파라미터처럼 사용하는 것 react-router-dom @6 버전 부터는 지원을 안한다
타입을 마치 함수의 파라미터처럼 사용하는 것
function getText< T >(text: T): T { return text; } getText < string > ('hi'); getText< number >(10); getText< boolean >(true); 함수를 호출 할때 함수 안에서 사용할 타입을 넘겨줄수 있다
function getText< T >(text: T): T { return text; } getText < string > ('hi'); getText< number >(10); getText< boolean >(true);