Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

342
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda