Last active
September 28, 2021 11:29
-
-
Save BrockReece/a6e73d4a2624aa8663891300852dcf52 to your computer and use it in GitHub Desktop.
Solid generic props
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 { JSX, For } from 'solid-js' | |
interface Props<T> { | |
items: T[] | |
children: T => JSX.Element | |
} | |
function GenericList<T> (props: Props<T>) { | |
return ( | |
<For each={ props.items }> | |
{ props.children } | |
</For> | |
) | |
} | |
export default GenericList |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment