Q:

ReactJs 0.14 - TreeView

Upgrading this example to React.js 0.14 .....
I am receiving an error when toggling:

Uncaught TypeError: Cannot read property 'setState' of null

import React, { Component } from 'react';
import ReactDOM from 'react-dom';
import classNames from 'classnames';
import { Link } from 'react-router';

export default class TreeNode extends Component {

  constructor(props) {
    super(props);
    this.state = {
      visible: true
    };
  }

  render() {
    let childNodes;
    let classObj;

    if (this.props.node.childNodes !== undefined) {
      childNodes = this.props.node.childNodes.map((node, index) => {
        return (
          <li key={ index }><TreeNode node={ node } /></li>
        );
      });
    }

    classObj = classNames({
      'togglable': true,
      'togglable-down': this.state.visible,
      'togglable-up': !this.state.visible
    });

    let style;
    if (!this.state.visible) {
      style = { display: 'none' };
    }

    return (
      <div>
        <h5 onClick={ this.toggle } className={ classObj }>
          { this.props.node.title }
        </h5>
        <ul style={ style } >
          { childNodes }
        </ul>
      </div>
    );
  }

  toggle() {
    this.setState({ visible: !this.state.visible });
  }
}

TreeNode.propTypes = {
  node: React.PropTypes.object
};

ReactDOM.render(<TreeNode node={ treeData } />, document.querySelector('#reactRoot'));

Anyone see my error?
Many thanks in advance if you can point it out.

A:

Nevermind, dumb, dumb, dumb .....
  <h5 onClick={ this.toggle.bind(this) } className={ classObj }>

