react-split-pane
react-split-pane copied to clipboard
Ver 2 SplitPane & TypeScript - Import Declarations Broken
Overview of Problem
I am using the new version of react-split-pane. I went and installed the '@next' version as described in your readme file..
npm install react-split-pane@next
However, with this version, I can not import Pane in a typescript project. the Typescript compiler complains that "react-split-pane has no exported modules 'Pane'"
I am using this syntax:
import SplitPane, { Pane } from 'react-split-pane';

If I try to import Pane specifically from its file location like this:
import Pane from 'react-split-pane/lib/Pane'
I get the following typescript error: "could not find declaration file for module 'react-split-pane/lib/Pane.js'

My Work-Around Solution
In the end, my work-around solution was to include ts-ignore comments above each import statement to silence the TypeScript compiler
// @ts-ignore
import SplitPane from 'react-split-pane/lib/SplitPane';
// @ts-ignore
import Pane from 'react-split-pane/lib/Pane'

Expected behavior
I suspect the type definitions are not currently for Pane. Will this be added when V2 is released?