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

203
Vistas
Conditional Import of 2 objets with the same name

How can I import 2 objects with the same name but conditionally use them on the page

I tried this, but import can be only on top so it doesn't work

if (window.location.href.includes('showcase')) {
  import { Tags } from "../../../data/folder1";
} else {
  import { Tags } from "../../../data/folder2";
}

I tried also this but I'm stuck:

 import { Tags } from "../../../data/folder1"
 import { Tags } from "../../../data/folder2"

const PageTags = window.location.href.includes('showcase') ? Tags : Tags <=== issue here

about 4 years ago · Juan Pablo Isaza
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