Open adarshaacharya opened 4 years ago
Yep. There is no Pane in lib/index.js exported.
Import it from "react-split-pane/lib/Pane"
Hi @mohamedajmaltm @enomado @adarshaacharya , are you guys getting any warning after using 2.0.3?
am getting the following warnings
is there any workaround for this, or shall i use the 0.. version of it?
Thanks in advance.
Same error here, there is no type with 'Pane'
Hi @mohamedajmaltm @enomado @adarshaacharya , are you guys getting any warning after using 2.0.3?
am getting the following warnings
is there any workaround for this, or shall i use the 0.. version of it?
Thanks in advance.
I think there is no other option than downgrading the version to v0.x.
Many people may be confused because the docs still show that new version is available. I think author should remove that part.
you can use react-split-pane-next
first declare type.d.ts
declare module "react-split-pane/lib/Pane" {
import * as React from "react";
export interface PaneProps {
initialSize?: string | number;
minSize?: string | number;
maxSize?: string | number;
className?: string;
style?: React.CSSProperties;
children?: React.ReactNode;
}
const Pane: React.FC<PaneProps>;
export default Pane;
}
Then use code behind
import SplitPane from "react-split-pane";
import Pain from "react-split-pane/lib/Pane";
{/* @ts-ignore */}
<SplitPane split="vertical" minSize={300} maxSize={1200}>
<Pain initialSize="70%" minSize="40%" maxSize="80%">
content 1
</Pain>
<Pain initialSize="30%" minSize="20%" maxSize="60%">
content 2
</Pain>
</SplitPane>
Describe the bug
Whenever I tried to import { Pane} from 'react-split-pane' I got following error.
Is Pane component deprecated ?
I'm using
"react-split-pane": "^2.0.3"
and"typescript": "~3.7.2"