Created
April 18, 2018 19:15
-
-
Save ioness/704acf1b55f2cdb052b72b5162a027a8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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