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

343
Vistas
Could not find a declaration file for module error in react

Typescript beginner here, trying to implement splitter to my project, i'm using SplitPane from "react-split-pane/lib/SplitPane" and Pane from "react-split-pane/lib/Pane" in my typescript project but its giving me this error:

Could not find a declaration file for module 'react-split-pane/lib/Pane'. 'C:/.../node_modules/react-split-pane/lib/Pane.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/react-split-pane` if it exists or add a new declaration (.d.ts) file containing `declare module 'react-split-pane/lib/Pane';`ts(7016)

it is working correctly without problem but still giving me that, it suggests to try '@types/react-split-pane' but that is not working anymore 'https://www.npmjs.com/package/@types/react-split-pane' 'This package has been deprecated'.

as i said in comments i imported it like this :

import SplitPane from "react-split-pane/lib/SplitPane";

import Pane from "react-split-pane/lib/Pane";

Any idea how to get rid of error ?

English is not my mother language so the could be mistakes.

my splitpane module:

enter image description here

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

0

i'm importing it like this : import SplitPane from "react-split-pane/lib/SplitPane"; import Pane from "react-split-pane/lib/Pane";

You really should never go drilling into the directory structure of libraries for imports, unless the documentations specifically tells you to.

According to the index file of that library, that's now how you are expected to import the values. The library exports like this:

export default SplitPane;
export { Pane };

And that means you should import those two values like this:

import SplitPane, { Pane } from 'react-split-pane'

Playground

It also works in a code sandbox with a full project:


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