import { ComponentType } from 'react'; export function withLoading<P extends object>( Component: ComponentType<P> ) { // TODO: 새 컴포넌트를 반환하세요. // - props에 isLoading: true가 오면 <div>Loading...</div> 렌더 // - 아니면 isLoading을 빼고 나머지 props로 Component 렌더 return function WithLoading(_props: P & { isLoading?: boolean }) { return null as any; }; }
Tests