Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

205
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda