-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeScript support #34
Comments
I'd like to have it, but I do not maintain it a lot at the moment. Any help is welcome. |
In your root folder add this folders declare module 'react-nestable' {
import * as React from 'react';
export type Item = {
id: string;
text: string;
children?: Item[];
nestedIn?: string | null;
link?: string | null;
type?: number;
};
export default class Nestable extends React.Component<{
items: Item[];
handler?: React.ReactNode;
renderItem: (arg: {
item: Item;
collapseIcon: React.ReactNode;
index: number;
handler: React.ReactNode;
}) => React.ReactNode;
maxDepth: number;
renderCollapseIcon?: (args: { isCollapsed: boolean }) => React.ReactNode;
onChange: (items: Item[]) => void;
confirmChange: (dragItem: Item, destinationParent: Item) => boolean;
}> {}
} |
Cool . . Great thanks... |
Now, to support typescript i'm install from here |
Hi @primetwig , any chance you could quickly include the type defs created by @herudi in the dist folder. Many thanks in advance, |
done in 2.0.0 |
Hi George, do you have any planning for TypeScript support?
The text was updated successfully, but these errors were encountered: