
고차 컴포넌트 Higher Order Component https://ko.reactjs.org/docs/higher-order-components.html https://jeonghwan-kim.github.io/2022/05/28/react-high-order-component 컴포넌트를 가져와서 새로운 컴포넌트를 반환하는 함수 함수형 컴포넌트에서도 사용할 수 있다. export default function Button() { const [loading, setLoading] = useState(true); useEffect(()=> { const timer = setTimeout(()=> setLoading(false), 1000)); return ()=> clearTimeout(timer); }..
FrontEnd/KDC
2022. 9. 27. 22:32