How to use JSX.HTMLAttributes<HTMLDivElement>?

import type { Component, JSX } from 'solid-js' export const LeeCenter:Component<JSX.HTMLAttributes<HTMLDivElement>> = p => ( <div {...p} class={flex justify-center items-center ${p.class}} > {p.children} </div> ) I want to make kind of wrapper of div. Is this ok? it seems working.
3 Replies
mdynnl
mdynnl2y ago
that seems correct, you can also use ComponentProps<'div'> which expands to JSX.HTMLAttributes<HTMLDivElement>
musiclover
musicloverOP2y ago
@mdynnl hmm no it doesn't work.
mdynnl
mdynnl2y ago
still need Component so it should be Component<ComponentProps<'div'>>
Want results from more Discord servers?
Add your server