I have very simple tsx component like this
import React, { CSSProperties } from "react";
const INPUT: CSSProperties = {
display: "flex",
flexDirection: "row",
};
const TEXT_INPUT: CSSProperties = {
fontWeight: "bold",
marginRight: "10px",
};
const CONTAINER: CSSProperties = {
alignItems: "center",
justifyContent: "center",
display: "flex",
};
export interface AddNoteInterface {
style?: CSSProperties;
}
export default function AddNote(props: AddNoteInterface) {
const { style } = props;
return (
<div style={[CONTAINER, style]}>. <----- ts complaint here
<div style={INPUT}>
<div style={TEXT_INPUT}>Text input</div>
<input />
</div>
</div>
);
}
but when i use array for multi style, it give me error :
Type 'CSSProperties[]' is not assignable to type 'Properties<string | number, string & {}>'.
Types of property 'filter' are incompatible.
What happen??? Please help, thank you a lots