UNPKG

react-custom-hooks-utils

Version:

This library contains a collection of reusable React custom hooks to simplify state management, side effects, and user interactions.

9 lines (7 loc) 211 B
import { Children } from 'react' export const Each = ({ render, of }) => { if (!Array.isArray(of)) { return null; } return Children.toArray(of.map((item, index) => render(item, index))); };