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
that seems correct, you can also use
ComponentProps<'div'>
which expands to JSX.HTMLAttributes<HTMLDivElement>
@mdynnl
hmm no it doesn't work.
![](https://cdn.answeroverflow.com/1134873976292778014/image.png)
still need
Component
so it should be Component<ComponentProps<'div'>>