https://github.com/zaikoxander/react-repeat-render
A simple React component that helps you render components multiple times using a render prop pattern.
https://github.com/zaikoxander/react-repeat-render
component helper iteration react repeat
Last synced: 25 days ago
JSON representation
A simple React component that helps you render components multiple times using a render prop pattern.
- Host: GitHub
- URL: https://github.com/zaikoxander/react-repeat-render
- Owner: ZaikoXander
- License: mit
- Created: 2024-11-19T01:47:58.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-11-19T01:55:24.000Z (6 months ago)
- Last Synced: 2025-04-29T00:51:38.548Z (about 1 month ago)
- Topics: component, helper, iteration, react, repeat
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/@zaikoxander/react-repeat-render
- Size: 24.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# @zaikoxander/react-repeat-render
## Overview
`@zaikoxander/react-repeat-render` is a simple React component that helps you render components multiple times using a render prop pattern. It provides a more declarative way to render multiple components for a specified number of times.
## Installation
To install the package, use npm or pnpm:
```sh
npm i @zaikoxander/react-repeat-render
```
or
```sh
pnpm i @zaikoxander/react-repeat-render
```## Usage
Here is an example of how to use the `Repeat` component:
```jsx
import Repeat from '@zaikoxander/react-repeat-render';export default function App() {
return (
Hello World!
}
/>
);
}
```## Props
The `Repeat` component accepts the following props:
- `times`: The number of times to repeat the rendering.
- `render`: A function that receives its index as arguments and returns the JSX to render.