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

223
Vistas
How does an import from node_modules really work in ReactJS?

I installed react-vis via npm install react-vis and its possible to write import { XYPlot, LineSeries } from 'react-vis';

I want to know how the systems knows where XYPlot and LineSeries are? I looked in the node_modules directory and there is no index.js.

The structure of the react-vis directory is the following

my-app/
├─ node_modules/
│  ├─ react-vis/
│  │  ├─ dist/
│  │  ├─ es/
│  │  ├─ CHANGELOG.md
│  │  ├─ LICENSE
│  │  ├─ package.json
│  │  ├─ README.md

How does this work? I researched and for example this does not helped me: Where { component } from 'react' is located when we are importing ReactJS?

Edit I think it looks in the package.json that is inside the react-vis directory. There are two entries that look interesting. "name": "dist" and "module": "es". I think that i have to look inside the dist directory. Inside the dist directory, there is an index.js file. I open this file and on line 318 it says exports.XYPlot = _xyPlot2.default;

In the es folder inside the index.js there is on line 98 this: export { _XYPlot as XYPlot }; I don't know if this is important.

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