Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

341
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!