diff --git a/stories/childless-nodes.js b/stories/childless-nodes.js
new file mode 100644
index 00000000..a9636ffb
--- /dev/null
+++ b/stories/childless-nodes.js
@@ -0,0 +1,52 @@
+import React, { Component } from 'react';
+import SortableTree from '../src';
+// In your own app, you would need to use import styles once in the app
+// import 'react-sortable-tree/styles.css';
+
+export default class App extends Component {
+ constructor(props) {
+ super(props);
+
+ this.state = {
+ treeData: [{
+ title: 'Managers',
+ expanded: true,
+ children: [{
+ title: 'Rob',
+ children: [],
+ isPerson: true
+ }, {
+ title: 'Joe',
+ children: [],
+ isPerson: true
+ }]
+ }, {
+ title: 'Clerks',
+ expanded: true,
+ children: [{
+ title: 'Bertha',
+ children: [],
+ isPerson: true
+ }, {
+ title: 'Billy',
+ children: [],
+ isPerson: true
+ }]
+ }],
+ };
+ }
+
+ render() {
+ return (
+
+
+ !node.isPerson}
+ onChange={treeData => this.setState({ treeData })}
+ />
+
+
+ );
+ }
+}
diff --git a/stories/index.js b/stories/index.js
index 1c5f0a84..04c171d7 100644
--- a/stories/index.js
+++ b/stories/index.js
@@ -6,6 +6,7 @@ import AddRemoveExample from './add-remove';
import BarebonesExample from './barebones';
import CallbacksExample from './callbacks';
import CanDropExample from './can-drop';
+import ChildlessNodes from './childless-nodes';
import DragOutToRemoveExample from './drag-out-to-remove';
import ExternalNodeExample from './external-node';
import GenerateNodePropsExample from './generate-node-props';
@@ -85,4 +86,7 @@ storiesOf('Advanced', module)
,
'only-expand-searched-node.js'
)
+ )
+ .add('Prevent some nodes from having children', () =>
+ wrapWithSource(
, 'childless-nodes.js')
);