File tree Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ const tree = [
1313 {
1414 value: 'Parent C',
1515 nodes: [
16- { value: 'Child D', id: 'test ' },
16+ { value: 'Child D', id: 'example-id ' },
1717 { value: 'Child E' },
1818 { value: 'Child F' },
1919 ],
@@ -24,7 +24,7 @@ const tree = [
2424
2525<MuiTreeView
2626 defaultExpanded
27- onLeafClick={( node) => alert(`${ JSON.stringify(node)}` )}
27+ onLeafClick={node => alert(JSON.stringify(node))}
2828 tree={tree}
2929/>
3030```
Original file line number Diff line number Diff line change @@ -21,7 +21,9 @@ import KeyboardArrowDown from '@material-ui/icons/KeyboardArrowDown';
2121const pickClassName = prop ( 'className' ) ;
2222/** Prop-type for a recursive data structure */
2323const tree = {
24+ // The node value.
2425 value : string . isRequired ,
26+ // Optional node ID. Useful for when the node value is not unique.
2527 id : oneOfType [ ( string , number ) ] ,
2628} ;
2729
Original file line number Diff line number Diff line change @@ -30,9 +30,7 @@ const tree = [
3030
3131class App extends Component {
3232 /* eslint-disable-next-line no-alert */
33- handleLeafClick = node =>
34- /* eslint-disable-next-line no-alert */
35- alert ( `${ JSON . stringify ( node ) } clicked` ) ;
33+ handleLeafClick = node => alert ( JSON . stringify ( node ) ) ;
3634
3735 render ( ) {
3836 return (
You can’t perform that action at this time.
0 commit comments