Repeat
Repeat는 children(index)를 times만큼 렌더링합니다. times가 positive integer가 아니면 fallback을 렌더링합니다.
import { Repeat } from '@ilokesto/utilinent';
<Repeat times={3}>{(index) => <SkeletonCard key={index} />}</Repeat>프로퍼티
| Prop | Type | 설명 |
|---|---|---|
times | number | Children을 렌더링하려면 positive integer여야 합니다. |
children | (index) => ReactNode | 0부터 times - 1까지 각 index마다 호출됩니다. |
fallback | ReactNode | invalid 또는 non-positive count일 때 렌더링됩니다. |
태그 형태
<Repeat.ul times={5} aria-label="loading rows">
{(index) => <li key={index}>Loading row {index + 1}</li>}
</Repeat.ul>Skeleton, placeholder star, fixed grid slot, 반복 decoration에 사용하세요.