Skip to content

Instantly share code, notes, and snippets.

@ioness
Created April 18, 2018 19:15
Show Gist options
  • Save ioness/704acf1b55f2cdb052b72b5162a027a8 to your computer and use it in GitHub Desktop.
Save ioness/704acf1b55f2cdb052b72b5162a027a8 to your computer and use it in GitHub Desktop.
import * as React from 'react'
interface Props {
indexes: [ number ],
component: any,
container: any
}
export default function List (props: Props): any {
const items: Array<any> = []
props.indexes.map((value: number, index: number): any => {
items.push(<props.component key={index} id={value.toString()}/>)
})
return (<props.container>{items}</props.container>)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment