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

204
Vistas
How to import same package name from different npm packages?
import { Draggable } from "react-beautiful-dnd";
import { Draggable } from "react-draggable";

Error
Identifier 'Draggable' has already been declared. (3:9)

What is the correct way to import the same Component name from two different sources? Especially importing two other npm packages with the same name from various sources?

about 4 years ago · Juan Pablo Isaza
3 Respuestas
Responde la pregunta

0

you can try this

import { Draggable as AnyName  } from "react-draggable";
about 4 years ago · Juan Pablo Isaza Denunciar

0

You can use an alias for one of the imports.

import { Draggable as BeautifulDraggable } from "react-beautiful-dnd";
import { Draggable } from "react-draggable";
about 4 years ago · Juan Pablo Isaza Denunciar

0

For the first import

import { Draggable } from "react-beautiful-dnd";

For the second import

import { Draggable as PreferredAlternativeName } from "react-draggable";

The alternative name would be a name to call the second component.

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