- Made the TreeItem.children prop optional since the library allows this and prevents verboseness/unneeded empty arrays

- Added 'dom' lib in tsconfig to fix dom errors from definition dependencies when running `tsc`
This commit is contained in:
Chris Smith
2017-07-13 13:55:52 -07:00
parent da1ee3c69e
commit b69cd5df97
3 changed files with 4 additions and 3 deletions

View File

@@ -15,7 +15,7 @@ export interface TreeItem {
title?: string;
subtitle?: string;
expanded?: boolean;
children: TreeItem[];
children?: TreeItem[];
[x: string]: any;
}

View File

@@ -21,7 +21,7 @@ class Test extends React.Component {
{
title: "Title", subtitle: "Subtitle", children: [
{title: "Child 1", subtitle: "Subtitle", children: []},
{title: "Child 2", subtitle: "Subtitle", children: []}
{title: "Child 2", subtitle: "Subtitle"}
]
}
];

View File

@@ -2,7 +2,8 @@
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
"es6",
"dom"
],
"noImplicitAny": true,
"noImplicitThis": true,