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
REEEEE12mo 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 Hengles12mo ago
Hmm, JSX! thanks!