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

1.5K
Vistas
Why computed values are not permitted in an enum?

I am trying the keep route url's in an enum like below.

export enum RouteUrls {
HOME = '/home',
DASHBOARD = `${HOME}/dashboard` // error here 
}

In the above line I am getting error as "Computed values are not permitted in an enum with string valued members.", is there any other way to achieve the same using Enum in TypeScript.

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

For now only numeric enums can have computed members. What you are trying to do is to have string enum with computed members, which is not permitted in TypeScript. I found that there is an open issue about this topic in official Microsoft TypeScript git repository. Maybe this feature will be implemented in the future versions.
URL to issue on git: https://github.com/microsoft/TypeScript/issues/40793

over 4 years ago · Santiago Trujillo 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