[React] 디바운스 함수로 입력 이벤트 최적화하기
·
✏️ Study/⚛️ React
📍디바운스 // App.tsx import "./styles.css"; import { useState } from "react"; import { useDebounce } from "./useDebounce"; export default function App() { const [keyword, setKeyword] = useState(""); const debouncedKeyword = useDebounce(keyword, 500); return ( Debounce + React + TypeScript {debouncedKeyword} setKeyword(e.target.value)} /> ); } // useDebounce.tsx import { useEffect, useState } from "r..