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

190
Visualizações
Type 'string[] | undefined' is not assignable to type 'string | undefined'

I am new to typescript. I am facing some while declaring Props in typescript as follows:

Types of property 'd' are incompatible.
Type 'string[] | undefined' is not assignable to type 'string | undefined'.

I have one xyzProps which contains some sting type and one is string[] as given below:

const d1: string[] = [];

type xyzProps = {
  a: string;
  b: string;
  c: string;
  d: typeof d1;
};

When I am trying to use the above propes as follows then it gives an error

export type abcPageProps = RouteComponentProps<Partial<xyzProps>> & ReduxProps;

Any idea why it gives me this error OR any solution for it.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

can you try

type xyzProps = {
   a: string;
   b: string;
   c: string;
   d: string[];
};

export type abcPageProps = RouteComponentProps<xyzProps> & ReduxProps;
about 4 years ago · Juan Pablo Isaza Relatório
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