Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

194
Visualizações
Type '(CSSProperties | undefined)[]' is not assignable to type 'Properties<string | number, string & {}>'

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

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda