typescript -Input KeyboardEvent-

김명성·2022년 3월 25일
0

typescript

목록 보기
1/8

input에 onChange가 아닌 onKeyup을 사용할 때에는 typescript의 이밴트 타입이 달라진다.

const onSearchValue = (e:React.KeyboardEvent<HTMLInputElement>):void =>{
        setSearchInputVal(e.currentTarget.value);
        console.log(searchInputVal);
    }

0개의 댓글