typescript cssproperties

Solid accepts a type CSSProperties in style attributes. I want to createMemo() with a style value, but I can't type it with CSSProperties type from Solid. What do I do ?
2 Replies
REEEEE
REEEEE2y ago
const myStyles = createMemo(() => {
const style: JSX.CSSProperties = {
width: '20px'
}
return style
})

<div style={myStyles()} />
const myStyles = createMemo(() => {
const style: JSX.CSSProperties = {
width: '20px'
}
return style
})

<div style={myStyles()} />
Rafael Hengles
Rafael HenglesOP2y ago
Hmm, JSX! thanks!
Want results from more Discord servers?
Add your server