Experimental
const Component = withForEach(3)(Example)
<Component {...props} />
// is equivalent to
<>
<Example key={0} {...props} i={0} />
<Example key={1} {...props} i={1} />
<Example key={2} {...props} i={2} />
</>
const Component = withForEach(["a", "b"])(Example)
<Component {...props} />
// is equivalent to
<>
<Example key={0} {...props} i={0}>a</Example>
<Example key={1} {...props} i={1}>b</Example>
</>
const Component = withForEach({
a: 100,
b: 200,
})(Example)
<Component {...props} />
// is equivalent to
<>
<Example key="a" {...props} i="a">100</Example>
<Example key="b" {...props} i="b">200</Example>
</>
Generated using TypeDoc
Like Array.map but for React components. Concatenates components for each item in array, range or object
It needs to discuss its name