Created
July 19, 2020 06:25
-
-
Save dgtlmonk/f4b5b759b545c6bad88731a13ae9a088 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
interface Props<T> { | |
items: T[]; | |
renderItem: (item: T) => React.ReactNode; | |
} | |
function List<T>(props: Props<T>) { | |
const { items, renderItem } = props; | |
const [state, setState] = React.useState<T[]>([]); | |
return ( | |
<div> | |
{items.map(renderItem)} | |
</div> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment