Error: Property 'height' does not exist on type 'CSSProperties'
KutnerUri opened this issue · comments
Kutner JS commented
Getting this very weird error when trying to read height
property:
Error: Property 'height' does not exist on type 'CSSProperties'
For example:
const props: CSSProperties = {
height: 3, // totally fine
};
const a = props.height; // ts error
any ideas?
using version ^3.0.2
, coming from types/react
: 18.0.7
maurer2 commented
Hello, v3 changed the way Properties are exposed (CSSProperties). The following should work:
import type * as CSS from 'csstype';
const props: CSS.Properties = {
height: '3px',
};
const a = props.height;
Cheers
Fredrik Nicol commented