Skip to content

Instantly share code, notes, and snippets.

@BrockReece
Last active September 28, 2021 11:29
Show Gist options
  • Save BrockReece/a6e73d4a2624aa8663891300852dcf52 to your computer and use it in GitHub Desktop.
Save BrockReece/a6e73d4a2624aa8663891300852dcf52 to your computer and use it in GitHub Desktop.
Solid generic props
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