I want to define jsx like this:
<table style={{'--length': array.lenght}}>
<tbody>
<tr>{array}</tr>
</tbody>
</table>
and I use --length
in CSS, I also have cells that have --count
that shows count using CSS pseudo selector (using the counter hack).
but typescript throws an error:
TS2326: Types of property 'style' are incompatible.
Type '{ '--length': number; }' is not assignable to type 'CSSProperties'.
Object literal may only specify known properties, and ''--length'' does not exist in type 'CSSProperties'.
is it possible to change the type of style attribute to accept CSS variables (custom properties) or is there a way to force any on the style object?
::before
and::after
. – Incorporator